/**
 * 提供公共下拉组件
 */
layui.define(['xmSelect'], function (exports) {
    let $ = layui.$,
        xmSelect = layui.xmSelect,
        zmnSelectCache = {};

    /**
     * 获取合并后的对象
     * @param source
     * @param defaultSource
     * @param target
     * @return {*}
     */
    function getMergedObj(source, defaultSource, target) {
        source = zmnUtil.isObject(source) ? source : {};
        target = zmnUtil.isObject(target) ? target : {};
        return $.extend(true, target, defaultSource, source);
    }

    /**
     * 获取指定属性
     * @param obj 对象
     * @param fieldLink 属性路径
     * @param defaultValue 默认值
     * @return {*}
     */
    function getField(obj, fieldLink, defaultValue) {
        if (!zmnUtil.isObject(obj)) {
            return defaultValue;
        }
        let links = fieldLink.split('.');
        for (let link of links) {
            let result = link in obj;
            if (result === false) {
                return defaultValue;
            }
            obj = obj[link];
        }
        return obj;
    }

    /**
     * 数组去重
     * @param array
     * @param propMap
     * @return {[]}
     */
    function uniqueArray(array, propMap) {
        let result = [];
        let obj = {};
        for (let i = 0, len = array.length; i < len; i++) {
            let key = array[i][propMap.value];
            if (!obj[key]) {
                result.push(array[i]);
                obj[key] = true;
            }
        }
        return result;
    }

    /**
     * 比较数组
     * @param arr1
     * @param arr2
     * @return {boolean}
     */
    function compareArray(arr1, arr2) {
        return JSON.stringify(arr1) == JSON.stringify(arr2);
    }

    /**
     * 为兼容旧业务的公司类型
     * @param oldType 旧业务的公司类型
     * @return {[]}
     */
    function convertCompanyType(oldType) {
        let types = [];
        if (zmnUtil.isNotInteger(oldType)) {
            return types;
        }
        oldType = parseInt(oldType);
        switch (oldType) {
            case 10:
                types.push({
                    type: 130, //公司类型：服务商
                    childType: 10, //公司子类型：信息公司
                });
                types.push({
                    type: 130, //公司类型：服务商
                    childType: 20,//非直营
                });
                break;
            case 11:
                types.push({
                    type: 130, //公司类型：服务商
                    childType: 10, //公司子类型：信息公司
                });
                break;
            case 12:
                types.push({
                    type: 130, //公司类型：服务商
                    childType: 20,//非直营
                });
                break;
            case 20:
                types.push({
                    type: 130, //公司类型：服务商
                    childType: 10, //公司子类型：信息公司
                });
                types.push({
                    type: 140, //公司类型：电器公司
                    childType: 10, //电器公司
                });
                break;
            case 21:
                types.push({
                    type: 140, //公司类型：电器公司
                    childType: 10, //电器公司
                });
                break;
        }
        return types;
    }

    //api网关地址
    let GATEWAY_API_BASE = ZMN_CONFIG.BASE_URL.GATEWAY_API_BASE;

    //默认的基础配置
    let defaultBasicOptions = {
        name: null, //表单提交时的name
        isReload: true, //初始化时，是否重载数据
        tips: "-选择-",   //默认提示
        searchTips: "请选择", //
        emptyTips: "没有找到相关结果",  //空值提示
        isRadio: false, //单选标识：true-单选；false-多选
        filterable: true, //是否开启搜索
        autoRow: true, //选择值换行
        showCount: 1, //选择值展示个数
        maxCount: 100, //下拉框中的最多选项数量
        sizeModel: "mini", //尺寸模式：medium；small；mini
        propMap: {  //选项参数映射配置
            name: "text",   //显示值
            value: "value"  //选中值
        },
        page: { //分配配置
            enable: false,  //开关：true-开启；false-关闭
            pageSize: 100,   //页数
            isShowEmpty: false, //无数据时是否显示分页
            remote: false, //远程分页开关：true-开启；false-关闭
        },
        tree: {
            //是否显示树状结构
            enable: false,
            //是否展示三角图标
            showFolderIcon: true,
            //是否显示虚线
            showLine: true,
            //间距
            indent: 20,
            //是否严格遵守父子模式
            strict: true,
            //默认展开节点的数组, 为 true 时, 展开所有节点
            expandedKeys: [],
            //懒加载开关
            lazy: false,
            events: {
                load: function (item, callback) {
                }
            }
        },
        events: {  //事件配置
            /**
             * 选择中事件
             * @param values 已选中值，Array类型
             */
            changing: function (values) {
            },
            /**
             * 选择完成后事件
             * @param values 已选中值，Array类型
             */
            changed: function (values) {
            },
            /**
             * 重载判断事件
             */
            reload: function (options) {
                return options.isReload;
            }
        },
    }

    //默认的数据源配置
    let defaultDataSourceOptions = {
        data: [], //静态下拉数据
        searchedValue: null, //已搜索值（用于回显）
        selectedValues: [], //已选中值（用于回显)
        remote: { //远程获取下拉数据
            enable: false, //开关：true-开启；false-关闭
            search: false, //自动请求标识：true-初始化完成后自动请求；false-不自动请求
            delay: 800, //搜索延迟（毫秒）
            url: null, //服务url
            limitPermit: false, //权限校验标识：true-校验；false-不校验
            events: { //事件配置
                /**
                 * 校验搜索值格式
                 * @param searchValue 搜索值
                 * @return {*|boolean}
                 */
                validate: function (searchValue) {
                    return true;
                },
                /**
                 * 扩展请求参数
                 * @param prevValues 上一级下拉框已选中的值数组（级联下拉框时有效）
                 * @param newExtendParams 自定义的扩展请求参数
                 * @return {{}}
                 */
                extendParams: function (prevValues, newExtendParams) {
                    return {}
                },
                /**
                 * 组装请求参数
                 * @param searchValue 搜索值
                 * @param limitPermit 权限校验标识
                 * @return {{limitPermit: boolean, keyword: *}}
                 */
                params: function (searchValue, limitPermit, pageIndex) {
                    return {
                        keyword: searchValue,
                        limitPermit: limitPermit === true,
                    }
                },
                /**
                 * 请求成功回调
                 * @param result 响应结果
                 * @param callback xmSelect回调函数
                 */
                success: function (result, callback, dataMap) {
                    let res = result.data;
                    let dm = (result.status == 200 || res.status == 200) ? dataMap(res) : {data: []};
                    if (zmnUtil.isInteger(dm.pageCount)) {
                        callback(dm.data, dm.pageCount);
                    } else {
                        callback(dm.data);
                    }
                },
                /**
                 * 请求异常回调
                 * @param error 异常信息
                 */
                error: function (error) {
                    console.log(error);
                },
                /**
                 * 数据映射
                 * @param result  响应结果
                 */
                dataMap: function (resultData) {
                    let data = [];
                    if (resultData.status == 200) {
                        data = resultData.data;
                    } else {
                        console.log(resultData.message);
                    }
                    return {
                        data: data
                    };
                }
            }
        },
    }

    let zmnSelect = {
        options: getMergedObj(defaultBasicOptions, defaultDataSourceOptions),
        /**
         * 合并自定义配置和默认配置
         * @param selectId
         * @param options
         * @param defaultOptions
         * @return {*}
         */
        mergeOptions: function (selectId, options, defaultOptions) {
            options = zmnUtil.isObject(options) ? options : {};
            defaultOptions = zmnUtil.isObject(defaultOptions) ? defaultOptions : {};
            let extendParamsEvent = getField(options, "remote.events.extendParams");
            if (zmnUtil.isFunction(extendParamsEvent)) {
                this.updateExtendParamsEvent(selectId, extendParamsEvent);
                delete options.remote.events.extendParams;
            }
            let defaultExtendParamsEvent = getField(defaultOptions, "remote.events.extendParams");
            if (zmnUtil.isFunction(defaultExtendParamsEvent)) {
                this.updateDefaultExtendParamsEvent(selectId, defaultExtendParamsEvent);
                delete defaultOptions.remote.events.extendParams;
            }
            let newOptions = getMergedObj(options, defaultOptions, {
                remote: {
                    events: {
                        extendParams: function (prevValues) {
                            let variables = cacheManager.getVariables(selectId);
                            let customExtendParamsEvent = zmnUtil.isObject(variables) ? variables.extendParamsEvent : null;
                            let customExtendParams = zmnUtil.isFunction(customExtendParamsEvent) ? customExtendParamsEvent(prevValues) : {};

                            let customExtendParamsEvents = zmnUtil.isObject(variables) ? variables.extendParamsEvents : null;
                            if (zmnUtil.isArray(customExtendParamsEvents) && customExtendParamsEvents.length > 0) {
                                for (let j = 0; j < customExtendParamsEvents.length; j++) {
                                    let otherCustomExtendParamsEvent = customExtendParamsEvents[j];
                                    let otherCustomExtendParams = zmnUtil.isFunction(otherCustomExtendParamsEvent) ? otherCustomExtendParamsEvent(prevValues) : {};
                                    customExtendParams = getMergedObj(otherCustomExtendParams, customExtendParams);
                                }
                            }

                            let defaultExtendParamsEvent = zmnUtil.isObject(variables) ? variables.defaultExtendParamsEvent : null;
                            return zmnUtil.isFunction(defaultExtendParamsEvent) ? defaultExtendParamsEvent(prevValues, customExtendParams) : customExtendParams;
                        }
                    }
                }
            });
            return newOptions;
        },
        /**
         * 创建xmSelect对象
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        createXmSelect: function (selectId, options) {
            let newOptions = getMergedObj(options, this.options);
            if (zmnUtil.isEmptyNull(newOptions.name)) {
                newOptions.name = selectId;
            }
            return xmSelectManager.create(selectId, newOptions);
        },
        /**
         * 创建多个xmSelect对象（支持联动）
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         */
        createXmSelects: function (optionsMap) {
            let selectMap = {};
            let selectIds = Object.keys(optionsMap);
            for (let i = 0; i < selectIds.length; i++) {
                let selectId = selectIds[i];
                let options = optionsMap[selectId];
                let changedEvent = getField(options, "events.changed");
                if (zmnUtil.isFunction(changedEvent)) {
                    delete options.events.changed;
                }
                let validateEvent = getField(options, "remote.events.validate");
                if (zmnUtil.isFunction(validateEvent)) {
                    delete options.remote.events.validate;
                }
                let newOptions = getMergedObj(options, {
                    remote: {
                        events: {
                            validate: function (searchValue) {
                                if (zmnUtil.isFunction(validateEvent)) {
                                    return validateEvent(searchValue) === true;
                                }
                                if (i > 0) {
                                    let prevSelectId = selectIds[i - 1];
                                    let prevSelect = selectMap[prevSelectId];
                                    let prevValues = prevSelect.getValue("value");
                                    return prevValues.length > 0;
                                }
                                return true
                            }
                        }
                    },
                    events: {
                        changed: function (values) {
                            if (values.length == 0) {
                                //清空所有下级下拉框
                                xmSelectManager.clearData(i + 1, selectIds, selectMap);
                            } else if (i < selectIds.length - 1) {
                                let oldValues = cacheManager.getCurrentValues(selectId);
                                let isRefresh = !compareArray(oldValues, values);
                                if (isRefresh) {
                                    //刷新下级下拉框
                                    let nextSelectId = selectIds[i + 1];
                                    let nextOptions = cacheManager.getOptions(nextSelectId);
                                    //下级组件为搜索下拉框时，只清空，不重载
                                    if (nextOptions.remote.search == true) {
                                        let variables = cacheManager.getVariables(nextSelectId);
                                        if (!zmnUtil.isObject(variables)) {
                                            variables = {}
                                        }
                                        variables.prevValues = values;
                                        cacheManager.setVariables(nextSelectId, variables);
                                        xmSelectManager.clearData(i + 1, selectIds, selectMap);
                                    } else {
                                        xmSelectManager.reload(nextSelectId, {}, values);
                                        //清空所有下下级下拉框
                                        xmSelectManager.clearData(i + 2, selectIds, selectMap);
                                    }

                                }
                            }
                            cacheManager.setCurrentValues(selectId, values);
                            if (zmnUtil.isFunction(changedEvent)) {
                                changedEvent(values);
                            }
                        }
                    }
                });
                if (cacheManager.existSelect(selectId)) {
                    selectMap[selectId] = xmSelectManager.update(selectId, newOptions);
                } else {
                    selectMap[selectId] = zmnSelect.createXmSelect(selectId, newOptions);
                }
            }
            return selectMap;
        },
        /**
         * 删除已创建的xmSelect
         * @param selectId
         */
        deleteXmSelect: function (selectId) {
            cacheManager.delSelect(selectId);
        },
        /**
         * 批量删除已创建的xmSelect
         * @param selectIds 字符串数组
         */
        deleteXmSelects: function (selectIds) {
            for (let i = 0; i < selectIds.length; i++) {
                this.deleteXmSelect(selectIds[i]);
            }
        },
        /**
         * 重载xmSelect的数据
         * @param selectId
         * @param options
         */
        reloadXmSelect: function (selectId, options) {
            xmSelectManager.reload(selectId, options)
        },
        /**
         * 重载多个xmSelect的数据
         * @param optionsMap 配置Map，格式：{selectId: options}
         */
        reloadXmSelects: function (optionsMap) {
            let selectIds = Object.keys(optionsMap);
            for (let i = 0; i < selectIds.length; i++) {
                let selectId = selectIds[i];
                let options = optionsMap[selectId];
                let isReload = zmnUtil.isObject(options.events) && zmnUtil.isFunction(options.events.reload) ? options.events.reload(options) : options.isReload;
                let prevValues = null;
                //针对多级下拉框时，如果上级下拉框无选中值，则不重载当前下拉框
                if (i > 0) {
                    //传递上级下拉框的选中值
                    let prevId = selectIds[i - 1];
                    let preOptions = optionsMap[prevId];
                    let values = preOptions.selectedValues;
                    if ((zmnUtil.isArray(values) && values.length > 0) || (!zmnUtil.isArray(values) && zmnUtil.isNotEmptyNull(values))) {
                        prevValues = values;
                    } else {
                        isReload = false;
                    }
                }
                if (isReload) {
                    xmSelectManager.reload(selectId, options, prevValues);
                }
            }
        },
        /**
         * 获取已创建的xmSelect对象
         * @param selectId
         * @return {*}
         */
        getXmSelect: function (selectId) {
            return zmnUtil.isNotEmptyNull(selectId) ? cacheManager.getSelect(selectId) : null;
        },
        /**
         * 获取已创建的下拉框配置
         * @param selectId
         * @return {*}
         */
        getOptions: function (selectId) {
            return cacheManager.getOptions(selectId);
        },
        /**
         * 更新已创建的下拉框配置
         * @param selectId
         * @param options
         */
        updateOptions: function (selectId, options) {
            xmSelectManager.update(selectId, options);
            let extendParamsEvent = getField(options, "remote.events.extendParams");
            if (zmnUtil.isFunction(extendParamsEvent)) {
                this.updateExtendParamsEvent(selectId, extendParamsEvent);
            }
        },
        /**
         * 更新扩展请求参数事件
         * @param selectId
         * @param extendParamsEvent
         * @param clearAll 清理所有缓存的扩展请求参数事件，默认为true
         */
        updateExtendParamsEvent: function (selectId, extendParamsEvent, clearAll = true) {
            let variables = cacheManager.getVariables(selectId);
            if (!zmnUtil.isObject(variables)) {
                variables = {}
            }
            variables.extendParamsEvent = extendParamsEvent;
            //清空其他扩展请求参数
            if (clearAll === true && zmnUtil.isArray(variables.extendParamsEvents)) {
                variables.extendParamsEvents = [];
            }
            cacheManager.setVariables(selectId, variables);
        },
        /**
         * 追加扩展请求参数事件
         * @param selectId
         * @param extendParamsEvent
         */
        appendExtendParamsEvent: function (selectId, extendParamsEvent) {
            let variables = cacheManager.getVariables(selectId);
            if (!zmnUtil.isObject(variables)) {
                variables = {}
            }

            if (zmnUtil.isArray(variables.extendParamsEvents)) {
                //排除重复函数
                let isPush = true;
                variables.extendParamsEvents.forEach(item => {
                    if (item.toString() == extendParamsEvent.toString()) {
                        isPush = false
                    }
                });
                if (isPush) {
                    variables.extendParamsEvents.push(extendParamsEvent);
                }
            } else {
                variables.extendParamsEvents = [extendParamsEvent];
            }
            cacheManager.setVariables(selectId, variables);
        },
        /**
         * 更新默认的扩展请求参数事件
         * @param selectId
         * @param defaultExtendParamsEvent
         */
        updateDefaultExtendParamsEvent: function (selectId, defaultExtendParamsEvent) {
            let variables = cacheManager.getVariables(selectId);
            if (!zmnUtil.isObject(variables)) {
                variables = {}
            }
            variables.defaultExtendParamsEvent = defaultExtendParamsEvent;
            cacheManager.setVariables(selectId, variables);
        },
        /**
         * 单个公共下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectBox: function (selectId, options) {
            let optionsMap = {};
            optionsMap[selectId] = options;
            let selectMap = this.selectBoxes({
                selectKey: {
                    id: selectId,
                    sn: 1,
                }
            }, {
                selectKey: options
            }, null);
            return selectMap[selectId];
        },
        /**
         * 公共下拉框（支持级联）
         * @param selectKeyMap 格式：
         * {
         *     selectKey: {
         *         id: null, //元素ID
         *         sn: 1, //序号，从1开始
         *     }
         * }
         * @param optionsMap 格式：
         * {
         *     selectKey: options //配置
         * }
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         */
        selectBoxes: function (selectKeyMap, optionsMap, commonOptions) {
            let selectIds = selectKeyManager.getSelectIds(selectKeyMap);
            let selectIdMap = selectKeyManager.getSelectIdMap(selectKeyMap);
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};
            commonOptions = zmnUtil.isObject(commonOptions) ? commonOptions : {}

            let newOptionsMap = {};
            for (let i = 0; i < selectIds.length; i++) {
                let selectId = selectIds[i];
                if (zmnUtil.isEmptyNull(selectId)) {
                    continue;
                }
                let selectKey = selectIdMap[selectId];

                let options = zmnUtil.isObject(optionsMap[selectKey]) ? optionsMap[selectKey] : optionsMap[selectId];

                let newOptions = getMergedObj(options, commonOptions);

                newOptions.isReload = zmnUtil.isEmptyNull(newOptions.isReload) ? true : newOptions.isReload;

                if (cacheManager.existSelect(selectId)) {

                    let oldOptions = cacheManager.getOptions(selectId);

                    newOptions.isReload = true;

                    if (oldOptions.isReload === true) {
                        if (zmnUtil.isNotEmptyNull(newOptions.selectedValues)) {
                            //存在已选中值时，需要重载数据
                            newOptions.isReload = true;
                        } else if (zmnUtil.isNotEmptyNull(newOptions.searchedValue)) {
                            //存在已搜索值时，需要重载数据
                            newOptions.isReload = true;
                        } else {
                            //已重载时，不需要再次重载
                            newOptions.isReload = false;
                        }
                    }

                    let extendParamsEvent = getField(newOptions, "remote.events.extendParams");
                    if (zmnUtil.isFunction(extendParamsEvent)) {
                        let oldExtendParamsEvent = getField(oldOptions, 'remote.events.extendParams');
                        if (zmnUtil.isFunction(oldExtendParamsEvent) && oldExtendParamsEvent.toString() !== extendParamsEvent.toString()) {
                            this.appendExtendParamsEvent(selectId, extendParamsEvent);
                        }
                        delete newOptions.remote.events.extendParams;
                    }
                }

                newOptionsMap[selectId] = newOptions;
            }
            let selectMap = this.createXmSelects(newOptionsMap);
            this.reloadXmSelects(newOptionsMap);
            return selectMap;
        },
        /**
         * 单个公共搜索下拉框
         * @param selectId
         * @param options
         * @param defaultOptions
         * @return xmSelect对象
         */
        searchBox: function (selectId, options) {
            let selectMap = this.searchBoxes({
                selectKey: {
                    id: selectId,
                    sn: 1
                }
            }, {
                selectKey: options
            }, null);
            return selectMap[selectId];
        },
        /**
         * 公共搜索下拉框（支持级联）
         * @param selectKeyMap 格式：
         * {
         *     selectKey: {
         *         id: null, //元素ID
         *         sn: 1, //序号，从1开始
         *     }
         * }
         * @param optionsMap
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         */
        searchBoxes: function (selectKeyMap, optionsMap, commonOptions) {
            let newCommonOptions = getMergedObj(commonOptions, {
                tips: '-搜索-',
                remote: {
                    enable: true,
                    search: true,
                    events: {
                        validate: function (searchValue) {
                            // 不为空，且至少2个汉字/2个英文字符/2个数字
                            if (zmnUtil.isNotEmptyNull(searchValue) && (/^(([\u4E00-\u9FA5]{2,})|([A-Za-z]{2,})|([0-9]{2,})).*$/.test(searchValue))) {
                                //缓存搜索内容
                                cacheManager.setSearchValue(selectKeyMap.selectKey.id, searchValue);
                                return true;
                            }
                            return false;
                        },
                    }
                },
                events: {
                    reload: function (options) {
                        return zmnUtil.isNotNull(options.searchedValue);
                    }
                }
            });
            return this.selectBoxes(selectKeyMap, optionsMap, newCommonOptions);
        },
        /**
         * 公共下拉框（支持多级联动）
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @deprecated
         * @see zmnSelect.selectBoxes
         */
        select: function (optionsMap) {
            let selectKeyMap = {};
            Object.keys(optionsMap).forEach(function (k, i) {
                selectKeyMap[k] = {
                    id: k,
                    sn: i + 1
                };
            })
            return zmnSelect.selectBoxes(selectKeyMap, optionsMap);
        },
        /**
         * 公共搜索下拉框（支持多级联动）
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @deprecated
         * @see zmnSelect.searchBoxes
         */
        search: function (optionsMap) {
            let selectKeyMap = {};
            Object.keys(optionsMap).forEach(function (k, i) {
                selectKeyMap[k] = {
                    id: k,
                    sn: i + 1
                };
            })
            return zmnSelect.searchBoxes(selectKeyMap, optionsMap);
        },
        /**
         * 获取已选中的选项值
         * @param selectId
         * @return {null|*}
         */
        getSelectedValue: function (selectId) {
            let select = zmnSelect.getXmSelect(selectId);
            if (zmnUtil.isObject(select)) {
                let currentValues = select.getValue("value");
                if (zmnUtil.isArray(currentValues) && currentValues.length > 0) {
                    return currentValues;
                }
                let selectedValues = cacheManager.getSelectedValues(selectId);
                if (zmnUtil.isArray(selectedValues) && selectedValues.length > 0) {
                    return selectedValues;
                }
            }
            return [];
        },
        /**
         * 获取已选中的选项文本
         * @param selectId
         * @return {null|*}
         */
        getSelectedText: function (selectId) {
            let select = zmnSelect.getXmSelect(selectId);
            if (zmnUtil.isObject(select)) {
                return select.getValue("name");
            }
            return null;
        },
        /**
         * 清除数据
         * @param selectId
         */
        clearData: function (selectId) {
            let select = zmnSelect.getXmSelect(selectId);
            if (zmnUtil.isObject(select)) {
                select.update({
                    data: []
                });
            }
        },
        /**
         * 搜索
         */
        triggerSearch: function (selectId, value) {
            let select = zmnSelect.getXmSelect(selectId);
            if (zmnUtil.isObject(select)) {
                xmSelectManager.triggerSearch(selectId, value);
            }
        },
        /**
         * 获取搜索内容
         * @param selectId 下拉框ID
         * @returns 搜索内容
         */
        getSearchValue(selectId) {
            return cacheManager.getSearchValue(selectId);
        },
        /**
         * 保存搜索内容
         * @param selectId
         * @param value
         */
        setSearchValue(selectId, value) {
            return cacheManager.setSearchValue(selectId, value);
        }
    }

    let xmSelectManager = {
        convertOptions: function (selectId, options) {
            let xmSelectOptions = {
                el: '#' + selectId,
                name: zmnUtil.isNotEmptyNull(options.name) ? options.name : selectId,
                filterable: options.filterable === false ? false : true, //是否开启搜索
                autoRow: options.autoRow === false ? false : true, //选择值换行
                tips: options.tips,
                searchTips: options.searchTips,
                empty: options.emptyTips,
                radio: options.isRadio === true ? true : false,
                clickClose: options.isRadio === true && options.tree.enable === true ? true : false,
                paging: options.page.enable === true ? true : false,
                pageSize: options.page.pageSize,
                pageEmptyShow: options.page.isShowEmpty === true ? true : false, //无数据时不展示分页
                showCount: options.maxCount, //与分页配置互斥, 开启分页后, 此配置无效
                size: options.sizeModel,
                prop: options.propMap,
                on: function (data) {
                    //arr:  当前多选已选中的数据
                    let arr = data.arr;
                    //change, 此次选择变化的数据,数组
                    // let change = data.change;
                    //isAdd, 此次操作是新增还是删除
                    let isAdd = data.isAdd;

                    let values = [];

                    //单选时，如果选择树形下拉的父级节点，则选中值默认取第一个叶子节点值，选择操作有效
                    if (options.tree.enable === true && options.isRadio === true && isAdd) {
                        arr = data.change.slice(0, 1);
                    }

                    if (arr.length > 0) {
                        arr.forEach(function (vt) {
                            values.push(vt[options.propMap.value]);
                        });
                    }

                    if (zmnUtil.isFunction(options.events.changing)) {
                        options.events.changing(values);
                    }

                    //单选时，如果选择树形下拉的父级节点，则选中值默认取第一个叶子节点值，选择操作有效
                    if (options.tree.enable === true && options.isRadio === true && isAdd) {
                        return data.change.slice(0, 1);
                    }

                }
            }
            //显示模式
            xmSelectOptions.model = {
                label: {
                    type: 'block',
                    block: {
                        //最大显示数量, 0:不限制
                        showCount: zmnUtil.isInteger(options.showCount) ? options.showCount : 1,
                        //是否显示删除图标
                        showIcon: true,
                    }
                }
            }
            //工具栏
            xmSelectOptions.toolbar = {
                show: options.isRadio === false ? true : false, //只有多选时显示
                list: ['ALL', 'CLEAR', 'REVERSE'] //ALL: 全选; CLEAR: 清空; REVERSE: 反选
            }
            //树
            xmSelectOptions.tree = {
                //是否显示树状结构
                show: options.tree.enable === true ? true : false,
                //是否展示三角图标
                showFolderIcon: options.tree.showFolderIcon === false ? false : true,
                //是否显示虚线
                showLine: options.tree.showLine === false ? false : true,
                //间距
                indent: zmnUtil.isInteger(options.tree.indent) && options.tree.indent > 0 ? options.tree.indent : 20,
                //是否严格遵守父子模式
                strict: options.tree.strict === false ? false : true,
                //默认展开节点的数组, 为 true 时, 展开所有节点
                expandedKeys: zmnUtil.isArray(options.tree.expandedKeys) || options.tree.expandedKeys === true ? options.tree.expandedKeys : [],
                //懒加载开关
                lazy: options.tree.lazy === true ? true : false,
                //懒加载事件
                load: function (item, callback) {
                    //item: 点击的节点, callback: 回调函数
                    if (zmnUtil.isFunction(options.tree.events.load)) {
                        options.tree.events.load(item, callback);
                    }
                }
            }
            if (zmnUtil.isArray(options.selectedValues)) {
                cacheManager.setSelectedValues(selectId, options.selectedValues);
            } else if (zmnUtil.isNotEmptyNull(options.selectedValues)) {
                cacheManager.setSelectedValues(selectId, [options.selectedValues]);
            }
            //静态数据
            if (zmnUtil.isArray(options.data) && options.data.length > 0) {
                xmSelectOptions.data = options.data;
                let selectedData = [];
                let selectedValues = cacheManager.getSelectedValues(selectId);
                options.data.forEach(e => {
                    if (zmnUtil.isArray(selectedValues) && selectedValues.includes(e[options.propMap.value])) {
                        e.selected = true
                    }
                    selectedData.push(e)
                })
                cacheManager.setSelectedData(selectId, selectedData);
            }

            //远程数据
            if (options.remote.enable === true) {
                xmSelectOptions.remoteSearch = options.remote.search;
                xmSelectOptions.delay = options.remote.delay;
                xmSelectOptions.pageRemote = options.page.remote;
                let extendParamsEvent = getField(options, "remote.events.extendParams", function () {
                    return {}
                });
                //searchValue: 搜索框的内容, 不开启搜索默认为空, callback: 回调函数, show: 当前下拉框是否展开, pageIndex: 当前第几页
                xmSelectOptions.remoteMethod = function (searchValue, callback, show, pageIndex) {
                    if (options.remote.enable != true) {
                        return;
                    }
                    // 回显
                    let selectedData = cacheManager.getSelectedData(selectId);
                    if (zmnUtil.isArray(selectedData) && selectedData.length > 0) {
                        //清空
                        cacheManager.setSelectedData(selectId, []);
                        return callback(selectedData, pageIndex);
                    }
                    if (options.remote.events.validate(searchValue) === false) {
                        return callback([], pageIndex);
                    }
                    // 提交参数
                    let params = options.remote.events.params(searchValue, options.remote.limitPermit, pageIndex);
                    let variables = cacheManager.getVariables(selectId);
                    //上级已选中值
                    let prevValues = zmnUtil.isObject(variables) && zmnUtil.isArray(variables.prevValues) ? variables.prevValues : [];
                    let extendParams = extendParamsEvent(prevValues);
                    // ajax请求
                    let requestBody = getMergedObj(params, extendParams);
                    axios({
                        method: 'post',
                        withCredentials: true,  // 支持跨域身份认证
                        url: options.remote.url,
                        data: {body: requestBody},
                    }).then(function (result) {
                        options.remote.events.success(result, callback, options.remote.events.dataMap);
                    }).catch(function (error) {
                        options.remote.events.error(error);
                    });
                }
            }
            return xmSelectOptions;
        },
        create: function (selectId, options) {
            let xmSelectOptions = this.convertOptions(selectId, options);
            let select = xmSelect.render(xmSelectOptions);
            //设置变更事件
            if (zmnUtil.isFunction(options.events.changed)) {
                select.update({
                    hide: function () {
                        let values = select.getValue("value");
                        options.events.changed(values);
                    }
                });
            }
            cacheManager.setSelect(selectId, select);
            cacheManager.setOptions(selectId, options);
            return select;
        },
        reload: function (selectId, options, prevValues) {
            let oldOptions = cacheManager.getOptions(selectId);
            let select = cacheManager.getSelect(selectId);
            options = zmnUtil.isObject(options) ? options : {}
            let searchedValue = options.searchedValue;
            if (zmnUtil.isArray(options.selectedValues)) {
                cacheManager.setSelectedValues(selectId, options.selectedValues);
            } else if (zmnUtil.isNotEmptyNull(options.selectedValues)) {
                cacheManager.setSelectedValues(selectId, [options.selectedValues]);
            }
            let newOptions = getMergedObj(options, {
                remote: {
                    events: {
                        success: function (result, callback, dataMap) {
                            let res = result.data;
                            if (result.status == 200 || res.status == 200) {
                                let dm = dataMap(res);
                                if (zmnUtil.isFunction(callback)) {
                                    if (zmnUtil.isInteger(dm.pageCount)) {
                                        callback(dm.data, dm.pageCount);
                                    } else {
                                        callback(dm.data);
                                    }
                                } else {
                                    select.update({
                                        data: dm.data
                                    });
                                }
                                //设置选择的值
                                let selectedValues = cacheManager.getSelectedValues(selectId);
                                if (zmnUtil.isArray(selectedValues)) {
                                    if (selectedValues.length > 0) {
                                        select.setValue(selectedValues);
                                        cacheManager.setSelectedValues(selectId, null);
                                    }
                                } else if (zmnUtil.isNotEmptyNull(selectedValues)) {
                                    select.setValue([selectedValues]);
                                    cacheManager.setSelectedValues(selectId, null);
                                }
                            }
                        },
                        error: function (error) {
                            console.log(error);
                        }
                    }
                }
            }, oldOptions);
            if (newOptions.remote.enable) {
                let paramsEvent = getField(newOptions, "remote.events.params", function (searchValue, limitPermit, pageIndex) {
                    return {
                        keyword: searchValue,
                        limitPermit: limitPermit,
                    };
                });
                let params = paramsEvent(searchedValue, newOptions.remote.limitPermit, 0);

                let extendParamsEvent = getField(newOptions, "remote.events.extendParams", function () {
                    return {}
                });

                let prevValueArr;
                //缓存扩展参数值
                if (zmnUtil.isNotEmptyNull(prevValues)) {
                    if (zmnUtil.isArray(prevValues)) {
                        prevValueArr = prevValues;
                    } else {
                        prevValueArr = [prevValues];
                    }
                    let variables = cacheManager.getVariables(selectId);
                    if (!zmnUtil.isObject(variables)) {
                        variables = {}
                    }
                    variables.prevValues = prevValueArr;
                    cacheManager.setVariables(selectId, variables);
                }

                let extendParams = extendParamsEvent(prevValueArr);

                let requestBody = getMergedObj(params, extendParams);

                // 相当于$.ajax
                axios({
                    async: false,
                    method: 'post',
                    withCredentials: true,  // 支持跨域身份认证
                    url: newOptions.remote.url,
                    data: {body: requestBody}
                }).then(function (result) {
                    newOptions.remote.events.success(result, null, newOptions.remote.events.dataMap);
                }).catch(function (error) {
                    newOptions.remote.events.error(error);
                });
            } else if (zmnUtil.isArray(newOptions.data)) {
                select.update({
                    data: newOptions.data
                });
                if (newOptions.data.length > 0) {
                    //设置选择的值
                    let selectedValues = cacheManager.getSelectedValues(selectId);
                    if (zmnUtil.isArray(selectedValues)) {
                        if (selectedValues.length > 0) {
                            select.setValue(selectedValues);
                        }
                    } else if (zmnUtil.isNotEmptyNull(selectedValues)) {
                        select.setValue([selectedValues]);
                    }
                }
            }
            return false;
        },
        update: function (selectId, options) {
            let select = cacheManager.getSelect(selectId);
            let oldOptions = cacheManager.getOptions(selectId);
            let newOptions = getMergedObj(options, oldOptions);
            let xmSelectOptions = this.convertOptions(selectId, newOptions);
            select.update(xmSelectOptions);
            //设置变更事件
            if (zmnUtil.isFunction(newOptions.events.changed)) {
                select.update({
                    hide: function () {
                        let values = select.getValue("value");
                        newOptions.events.changed(values);
                    }
                });
            }
            cacheManager.setSelect(selectId, select);
            cacheManager.setOptions(selectId, newOptions);
            return select;
        },
        clearData: function (startIndex, selectIds, selectMap) {
            for (let i = startIndex; i < selectIds.length; i++) {
                let nextSelectId = selectIds[i];
                let nextSelect = selectMap[nextSelectId];
                nextSelect.update({data: []});
            }
        },
        /**
         * 触发xmSelect的远程搜索功能
         * @param selectId
         */
        triggerSearch: function (selectId, value = '', defaultValue = 'test') {
            let evt = document.createEvent('HTMLEvents')
            evt.initEvent('input', true, true)
            //默认值触发远程搜索方法
            $('#' + selectId).find('.xm-search-input').val(defaultValue)
            $('#' + selectId).find('.xm-search-input').get(0).dispatchEvent(evt)
            //远程搜索方法真实搜索的内容
            $('#' + selectId).find('.xm-search-input').val(value);
            $('#' + selectId).find('.xm-search-input').get(0).dispatchEvent(evt)
        }
    }

    let selectKeyManager = {
        /**
         * 获取元素ID键值对
         * @param selectIdMap 格式：
         * {
         *     selectKey: {
         *         id: null, //元素ID
         *         sn: 1, //序号，从1开始
         *     }
         * }
         */
        getSelectIdMap: function (selectKeyMap) {
            selectKeyMap = zmnUtil.isObject(selectKeyMap) ? selectKeyMap : {};
            let selectIdMap = {};
            for (const [key, value] of Object.entries(selectKeyMap)) {
                if (zmnUtil.isNotNull(value.id)) {
                    selectIdMap[value.id] = key
                }
            }
            return selectIdMap;
        },
        /**
         * 提取元素ID集合
         * @param selectIdMap 格式：
         * {
         *     selectKey: {
         *         id: null, //元素ID
         *         sn: 1, //序号，从1开始
         *     }
         * }
         */
        getSelectIds: function (selectKeyMap) {
            selectKeyMap = zmnUtil.isObject(selectKeyMap) ? selectKeyMap : {};
            return Object.values(selectKeyMap).filter(v => zmnUtil.isNotNull(v.id)).sort((v1, v2) => v1.sn - v2.sn).map(v => v.id)
        },

    }

    // 缓存管理器
    let cacheManager = {
        /**
         * 设置缓存
         * @param key 键
         * @param fieldName 属性名
         * @param fieldValue 属性值
         */
        setCache: function (key, fieldName, fieldValue) {
            if (!zmnSelectCache.hasOwnProperty(key)) {
                zmnSelectCache[key] = {};
            }
            zmnSelectCache[key][fieldName] = fieldValue;
        },
        /**
         * 获取缓存
         * @param key 键
         * @param fieldName 属性名
         * @return {*}
         */
        getCache: function (key, fieldName) {
            let cache = zmnSelectCache[key];
            return zmnUtil.isObject(cache) ? cache[fieldName] : {};
        },
        getKey: function (id) {
            return '#' + id;
        },
        existSelect: function (id) {
            let select = this.getSelect(id);
            return zmnUtil.isObject(select) && Object.keys(select).length > 0;
        },
        /**
         * 设置配置
         * @param selectId
         * @param options
         */
        setOptions: function (id, options) {
            let key = this.getKey(id);
            this.setCache(key, 'options', options);
        },
        /**
         * 获取配置
         * @param selectId
         * @return {null|*}
         */
        getOptions: function (id) {
            let key = this.getKey(id);
            return this.getCache(key, 'options');
        },
        /**
         * 设置下拉实例
         * @param selectId
         * @param select
         */
        setSelect: function (id, select) {
            let key = this.getKey(id);
            this.setCache(key, "select", select)
        },
        /**
         * 获取下拉实例
         * @param selectId
         * @return {null|*}
         */
        getSelect: function (id) {
            let key = this.getKey(id);
            return this.getCache(key, "select");
        },
        delSelect: function (id) {
            let key = this.getKey(id);
            delete zmnSelectCache[key];
        },
        /**
         * 设置中间变量
         * @param selectId
         * @param params
         */
        setVariables: function (id, variables) {
            let key = this.getKey(id);
            this.setCache(key, 'variables', variables);
        },
        /**
         * 获取中间变量
         * @param selectId
         * @return {*}
         */
        getVariables: function (id) {
            let key = this.getKey(id);
            return this.getCache(key, 'variables')
        },
        /**
         * 设置已选中值（用于回显）
         * @param id
         * @param values
         */
        setSelectedValues: function (id, values) {
            let key = this.getKey(id);
            this.setCache(key, "selectedValues", values);
        },
        getSelectedValues: function (id) {
            let key = this.getKey(id);
            return this.getCache(key, "selectedValues");
        },
        /**
         * 设置已选中的数据集合（用于回显）
         * @param id
         * @param data
         */
        setSelectedData: function (id, data) {
            let key = this.getKey(id);
            this.setCache(key, "selectedData", data);
        },
        getSelectedData: function (id) {
            let key = this.getKey(id);
            return this.getCache(key, "selectedData");
        },
        /**
         * 设置当前值
         * @param id
         */
        setCurrentValues: function (id, values) {
            let key = this.getKey(id);
            this.setCache(key, "currentValues", values);
        },
        getCurrentValues: function (id) {
            let key = this.getKey(id);
            return this.getCache(key, "currentValues");
        },
        /**
         * 设置搜索内容
         * @param id 下拉选项的内容
         * @param value 搜索内容
         */
        setSearchValue: function (id, value) {
            if (zmnUtil.isNotEmptyNull(value)) {
                this.setCache(id, "searchValue", value);
            }
        },
        /**
         * 获取搜索值
         * @param id
         * @returns {*}
         */
        getSearchValue: function (id) {
            return this.getCache(id, "searchValue");
        }
    }

    let selectMethods = {
        /**
         * 渠道类型下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectChannelType: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-plat',
                                configKey: 'channel_type',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({text: resultData[i].attributes.text, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 渠道中心下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectChannelCenter: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-plat',
                                configKey: 'channel_center',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({text: resultData[i].attributes.text, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 录单部门
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectEntryOrderOneDep: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-plat',
                                configKey: 'entry_order_dep',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({text: resultData[i].attributes.text, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 操作人类型
         * @param selectId
         * @param options
         */
        selectOperatorType: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-plat',
                                configKey: 'operator_type',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({text: resultData[i].attributes.text, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 通用状态下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectStatus: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-plat',
                                configKey: 'common_status',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({text: resultData[i].attributes.text, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 业务类型下拉框
         * @param selectId
         * @param options
         */
        selectBizType: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-plat',
                                configKey: 'biz_type',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({text: resultData[i].attributes.text, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 子级组织机构下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "parentId": null, //父级ID（用于单个下拉时必填，用于级联下拉时非必填）：Integer类型；
         *                }
         *             }
         *         }
         *     }
         * }
         * @return {xmSelect对象}
         */
        selectChildrenOrganize: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "orgName",   //显示值
                    value: "orgId"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/mcc/sapi/organize/listByParentId',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let parentId = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : newExtendParams.parentId;
                            return $.extend(true, {}, {parentId: parentId}, newExtendParams)
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 组织架构下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台：Integer类型；
         *                  "level": null, //层级： Integer类型；
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                  "parentIdList": null //父级ID集合：Integer类型集合，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         */
        selectOrganize: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/mcc/sapi/organize/list',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                status: 2,
                            }, newExtendParams)
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 平台下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectPlat: function (selectId, options) {
            return this.selectOrganize(selectId, $.extend(true, {}, {
                remote: {
                    events: {
                        extendParams: function () {
                            return {
                                level: 1
                            }
                        }
                    }
                }
            }, options));
        },

        /**
         * 1级渠道下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "type": null, //渠道类型：Integer类型；1政企渠道，2平台渠道，3厂家渠道，4自有渠道，5推广渠道，6服务商渠道，7啄金客渠道，null不限
         *                  "centId": null, //所属中心：Integer类型；null不限
         *                  "deptId": null, //所属部门：Integer类型；null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.selectChannelOne
         */
        selectOneChannel: function (selectId, options) {
            return this.selectChannelOne(selectId, options);
        },
        /**
         * 1级渠道下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "type": null, //渠道类型：Integer类型；1政企渠道，2平台渠道，3厂家渠道，4自有渠道，5推广渠道，6服务商渠道，7啄金客渠道，null不限
         *                  "centId": null, //所属中心：Integer类型；null不限
         *                  "deptId": null, //所属部门：Integer类型；null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        selectChannelOne: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/channel/api/channelListRemoteService/listChannelOptionByQuery',
                    events: {
                        params: function (searchValue, limitPermit, pageIndex) {
                            return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                searchQuery: {
                                    limitPermit: limitPermit === true
                                }
                            };
                        },
                        extendParams: function (prevValues, newExtendParams) {
                            let type = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null;
                            return $.extend(true, {}, {
                                searchQuery:{ parentId: 1,
                                    type: type}
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    },
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 子公司下拉框
         * @param selectId
         * @param options
         * 附加参数
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识(必填)：Integer类型；null不限
         *                  "type":类型：100平台公司，110大区，120子公司，130服务商，140电器公司，200渠道，220企业客户，230厂商客户，300支付平台，310配件供应商，320整机供应商，330配送供应商
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        selectSubCompany: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/common_data/api/company/listOptionPageByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return {
                                query: $.extend(true, {}, {
                                    type: 120,
                                    status: 2,
                                }, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            let result = {
                                query: {
                                    keyword: searchValue,
                                    limitPermit: limitPermit === true
                                }
                            };
                            if (zmnUtil.isEmptyNull(limitPermit)) {
                                delete result.query.limitPermit;
                            }
                            return result;
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 服务商下拉框
         * @param selectId
         * @param options
         * 附加参数
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识(必填)：Integer类型；null不限
         *                  "type":类型：100平台公司，110大区，120子公司，130服务商，140电器公司，200渠道，220企业客户，230厂商客户，300支付平台，310配件供应商，320整机供应商，330配送供应商
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        selectSpCompany: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/common_data/api/company/listOptionPageByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return {
                                query: $.extend(true, {}, {
                                    type: 130,
                                    companyTypeQueryList: convertCompanyType(10),
                                    status: 2
                                }, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                query: {
                                    limitPermit: limitPermit === true
                                }
                            }
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },

        /**
         * 省份下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectProvince: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/common_data/api/listAreaOptionByParentIdsAndLevel',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return {
                                query: {
                                    parentId: 1,
                                    level: 2
                                }
                            }
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                query: {
                                    limitPermit: limitPermit === true
                                }
                            }
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },

        /**
         * 城市下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "provinceId": null, //省份ID：Integer类型；null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        selectCity: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value"
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/common_data/api/listAllCityOption',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                query: {limitPermit: false}
                            }, newExtendParams)
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                query: {
                                    limitPermit: limitPermit === true
                                }
                            };
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            }
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },

        /**
         * 区县下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "cityId": null, //城市ID：Integer类型；null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        selectCounty: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/common_data/api/listAreaOptionByParentIdsAndLevel',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let cityId = newExtendParams.cityId;
                            let parentIds = []
                            if (zmnUtil.isNotEmptyNull(cityId)) {
                                parentIds.push(cityId);
                            }
                            if (zmnUtil.isArray(prevValues) && prevValues.length > 0) {
                                parentIds = parentIds.concat(prevValues)
                            }
                            return $.extend(true, {}, {
                                query: {
                                    parentIdList: parentIds,
                                    level: 4
                                }
                            }, newExtendParams)
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                query: {
                                    limitPermit: limitPermit === true
                                }
                            };
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },

        /**
         * 网格下拉框
         * @param selectId
         * @param countySelectId
         * @param options
         * @return xmSelect对象
         */
        selectGrid: function (selectId, countySelectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                isReload: false, //初始化时，是否重载数据
                propMap: {
                    name: "gridName",
                    value: "gridId",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/gms/api/listGridByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let params = {};
                            if (zmnUtil.isNotEmptyNull(countySelectId)) {
                                params["countyIdList"] = prevValues;
                            } else {
                                params["cityIdList"] = prevValues;
                            }
                            params["validStatus"] = newExtendParams.validStatus;
                            return $.extend(true, {}, {
                                onlineGridQuery: params
                            })
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },


        /**
         * 跟单类型
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectOrderTrackType: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "categName",
                    value: "categId",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/track/api/listTrackCategoryByStatus',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                status: 2,
                            }, newExtendParams)
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },

        /**
         * 内容下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * @return xmSelect对象
         */
        selectOrderTrackContent: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "trackContent",
                    value: "trackContentId",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/track/api/listTrackContentByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let categIds = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues : null;
                            console.log(categIds);
                            return $.extend(true, {}, {
                                confTrackQuery: {"categIds": categIds},
                            }, newExtendParams)
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },

        /**
         * 缘由下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectOrderTrackReason: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "reason",
                    value: "reasonId",
                },
                isReload: false, //初始化时，是否重载数据
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/track/api/listTrackReasonByTrackContentIdList',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let trackIds = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues : null;
                            return $.extend(true, {}, {
                                rackContentIdList: trackIds,
                            })
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },


        /**
         * 服务分类下拉框
         * @param selectId
         * @param options
         */
        selectServCategory: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/product/api/serv/categ/listOption',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {showType: '2'}, newExtendParams);
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 服务分类下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.selectServCategory
         */
        selectServiceCategory: function (selectId, options) {
            return this.selectServCategory(selectId, options);
        },

        /**
         * 推广分类下拉框（不支持数据权限）
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectMarketCategory: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/plat/capi/marketCategory/listMarketCategoryVt',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {parentId: 1}, newExtendParams);
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 1级产品分类下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "servCategoryId": null, //类型（必填）：Integer类型；
         *                  "showType": null, //类型（必填）：Integer类型，1表示后台，2表示前台；
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.selectProdCategOne
         */
        selectOneProdCategory: function (selectId, options) {
            return this.selectProdCategOne(selectId, options);
        },
        /**
         * 1级产品分类下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "servCategoryId": null, //类型（必填）：Integer类型；
         *                  "showType": null, //类型（必填）：Integer类型，1表示后台，2表示前台；
         *                }
         *             }
         *         }
         *     }
         * }
         * @return {xmSelect对象}
         */
        selectProdCategOne: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/product/api/serv/categ/product/listOptionByParentId',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return newExtendParams;
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 2级产品分类下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "servCategId": null, //类型（必填）：Integer类型；
         *                  "categIdList": null, //类型（必填）：Integer类型，1表示后台，2表示前台；
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.selectProdCategTwo
         */
        selectTwoProdCategory: function (selectId, options) {
            return this.selectProdCategTwo(selectId, options);
        },
        /**
         * 2级产品分类下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "servCategId": null, //类型（必填）：Integer类型；
         *                  "categIdList": null, //类型（必填）：Integer类型，1表示后台，2表示前台；
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        selectProdCategTwo: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/product/api/serv/categ/product/listOptionByParentId',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return newExtendParams;
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 1级业务产品分类下拉框 （不支持数据权限）
         * @param selectId
         * @param options
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.selectErpCategOne
         */
        selectOneErpCategory: function (selectId, options) {
            return this.selectErpCategOne(selectId, options);
        },
        /**
         * 1级业务产品分类下拉框 （不支持数据权限）
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectErpCategOne: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/product/api/serv/categ/product/listOptionByParentId',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {showType: 1, level: 1}, newExtendParams);
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 1级前台产品分类下拉框 （不支持数据权限）
         * @param selectId
         * @param options
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.selectEcCategOne
         */
        selectOneEcCategory: function (selectId, options) {
            return this.selectEcCategOne(selectId, options);
        },
        /**
         * 1级前台产品分类下拉框 （不支持数据权限）
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectEcCategOne: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/product/api/serv/categ/product/listOptionByParentId',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {showType: 2, level: 1}, newExtendParams);
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 1级部门下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.selectChannelOneDept
         */
        selectDept: function (selectId, options) {
            return this.selectChannelOneDept(selectId, options);
        },
        /**
         * 1级部门下拉框
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectChannelOneDept: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "deptName",   //显示值
                    value: "deptId"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/mcc/sapi/dept/listByLevel',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                level: 1,
                                status: 2,
                            }, newExtendParams);
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 录单部门级联下拉框：1级部门/2级部门/3级部门：
         * 子级联下拉框：
         * 1级部门/2级部门/3级部门
         * @param selectIdMap  格式：
         * {
         *      channelCentSelectId: null, //渠道中心
         *      deptOneSelectId: null, //1级部门ID
         * }
         * @param optionsMap
         * @param commonOptions
         */
        selectEntryOrderDepts: function (selectIdMap, optionsMap, commonOptions) {

            let entryOrderDeptOneSelectId = selectIdMap.entryOrderDeptOneSelectId;
            let entryOrderDeptTwoSelectId = selectIdMap.entryOrderDeptTwoSelectId;
            let entryOrderDeptThreeSelectId = selectIdMap.entryOrderDeptThreeSelectId;


            if (zmnUtil.isNotEmptyNull(entryOrderDeptOneSelectId)) {
                selectMethods.selectEntryOrderOneDep(entryOrderDeptOneSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择一级部门-",
                });
            }

            if (zmnUtil.isNotEmptyNull(entryOrderDeptTwoSelectId)) {

                selectMethods.selectOrganizeDept(entryOrderDeptTwoSelectId, {
                    isReload: false,
                    isRadio: false,
                    tips: "-选择二级部门-",
                })
            }

            if (zmnUtil.isNotEmptyNull(entryOrderDeptThreeSelectId)) {
                selectMethods.selectOrganizeDept(entryOrderDeptThreeSelectId, {
                    isReload: false,
                    tips: "-选择三级部门-",
                    remote: {
                        events: {
                            extendParams: function () {
                                return {
                                    level: 3,
                                }
                            }
                        }
                    }
                });
            }

            return zmnSelect.selectBoxes({
                entryOrderDeptOneSelectId: {
                    id: entryOrderDeptOneSelectId,
                    sn: 1
                },
                entryOrderDeptTwoSelectId: {
                    id: entryOrderDeptTwoSelectId,
                    sn: 2,
                },
                entryOrderDeptThreeSelectId: {
                    id: entryOrderDeptThreeSelectId,
                    sn: 3,
                }
            }, optionsMap, commonOptions);
        },
        /**
         * 部门下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "orgId": null, //组织ID：Integer类型，null不限
         *                  "parentId": null, //父级ID：Integer类型，null不限
         *                  "parentIdList": null, //父级ID集合：Integer类型集合，null不限
         *                  "level": null, //层级：Integer类型，null不限
         *                  "status": null, //状态：Integer类型，1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        // selectOrganizeDept， orgId必须， parentId必须
        selectOrganizeDept: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "deptName",
                    value: "deptId",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/mcc/sapi/dept/list',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let parentIds = []
                            let parentId = newExtendParams.parentId
                            if (zmnUtil.isNotEmptyNull(parentId)) {
                                parentIds.push(parentId);
                            }
                            if (zmnUtil.isArray(prevValues)) {
                                parentIds = parentIds.concat(prevValues);
                            }
                            return $.extend(true, {}, {
                                parentIdList: parentIds,
                                status: 2,
                            }, newExtendParams);
                        }
                    }
                }
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 部门树形下拉
         * @param selectId 页面的下拉对象ID
         * @param options
         * @returns {{}}
         */
        selectOrganizeDeptTree: function (selectId, options) {
            let newOption = zmnSelect.mergeOptions(selectId, options, {
                isRadio: true, //单选标识：true-单选；false-多选
                selectedValues: [], //已选中值（用于回显),格式：[value1,value2]
                tree: {
                    enable: true,
                    //默认展开节点的数组, 为 true 时, 展开所有节点
                    expandedKeys: false,
                    //懒加载开关
                    lazy: true,
                    //是否遵循严格父子结构
                    strict: false,
                },
                propMap: {  //选项参数映射配置
                    name: "deptName",   //显示值
                    value: "deptId"  //选中值
                },
                events: {  //事件配置
                    /**
                     * 选择中事件
                     * @param values 已选中值，Array类型
                     */
                    changing: function (values) {
                        console.log("==========自定义单个树形下拉框=========");
                        console.log("正选中的值:" + values);
                    }
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/mcc/api/mcc/listDeptByOrgId',
                    events: {
                        /**
                         * 请求参数
                         */
                        extendParams: function (prevValues, newExtendParams) {
                            if (zmnUtil.isNotEmptyNull(options.orgId)) {
                                return {"orgId": parseInt(options.orgId)}
                            }
                        },
                        /**
                         * 数据映射
                         * @param result  响应结果
                         */
                        dataMap: function (resultData) {
                            let treeData = {};
                            if (resultData.status == 200) {
                                treeData = resultData.data;
                            }
                            //展示数据
                            let treeDataNew = organizeUtil.makeOrganizeTree(treeData);
                            return {
                                data: treeDataNew
                            };
                        }
                    }
                }

            });

            let newObject = {};
            newObject[selectId] = newOption;

            return zmnSelect.select(newObject);
        },
        /**
         * 平台店铺联下拉框：平台/店铺：
         * 子级联下拉框：
         * @param selectIdMap  格式：
         * {
         *      platSelectId: null, //渠道中心
         *      shopSelectId: null, //1级部门ID
         * }
         * @param optionsMap
         * @param commonOptions
         */
        selectPlatShop: function (selectIdMap, optionsMap, commonOptions) {

            let platSelectId = selectIdMap.platSelectId;
            let shopSelectId = selectIdMap.shopSelectId;

            if (zmnUtil.isNotEmptyNull(platSelectId)) {
                selectMethods.selectShopPlat(platSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择平台-",
                });
            }

            if (zmnUtil.isNotEmptyNull(shopSelectId)) {
                selectMethods.selectShop(shopSelectId, {
                    isReload: false,
                    isRadio: false,
                    tips: "-选择门店-",
                })
            }
            return zmnSelect.selectBoxes({
                platSelectId: {
                    id: platSelectId,
                    sn: 1
                },
                shopSelectId: {
                    id: shopSelectId,
                    sn: 2,
                }
            }, optionsMap, commonOptions);
        },
        /**
         * 门店平台
         * @param selectId
         * @param options
         * @return xmSelect对象
         */
        selectShopPlat: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-market',
                                configKey: 'shop_plat',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({text: resultData[i].attributes.text, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 店铺
         * @param platSelectId 平台下拉对象ID
         * @param selectId 店铺下拉对象ID
         * @param options  自定属性
         */
        selectShop: function (selectId, options) {

            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "text",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dms/api/coupStore/listPageVtByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {

                            var plat = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null;

                            return $.extend(true, {}, {coupStoreDIO: {type: plat, status: 2}}, newExtendParams);
                        }
                    }
                }
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 推广账号
         * @param selectId 选择ID
         * @param options
         * @returns {xmSelect对象}
         */
        selectPromotionAccount: function (selectId, options) {

            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "name",
                    value: "appId",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/market/api/app/listDataSelectOptions',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {status: 2}, newExtendParams);
                        }
                    }
                }
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 第三方平台
         * @param selectId 选择ID
         * @param options
         * @returns {xmSelect对象}
         */
        selectThirdPlat: function (selectId, options) {

            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "name",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-market',
                                configKey: 'third_plat',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({name: resultData[i].attributes.name, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 推广平台
         * @param selectId 选择ID
         * @param options
         * @returns {xmSelect对象}
         */
        selectExpandPlat: function (selectId, options) {

            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/dove/api/listDataDictByKey',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                appKey: 'zmn-market',
                                configKey: 'expand_plat',
                            }, newExtendParams)
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                resultData = resultData.data;
                                for (let i = 0; i < resultData.length; i++) {
                                    data.push({text: resultData[i].attributes.name, value: resultData[i].dataKey});
                                }
                            }
                            return {
                                data: data
                            };
                        }
                    }
                },
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },

        /**
         * 推广品牌 品牌类型/品牌名称 联动下拉
         * @param selectIdMap{expandProduceTypeSelectId:类型ID,expandProduceNameSelectId:名称ID}
         * @param optionsMap
         * @param commonOptions
         * @returns {{}}
         */
        selectExpandProduct: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};
            let expandProduceTypeSelectId = selectIdMap.expandProduceTypeSelectId;
            let expandProduceNameSelectId = selectIdMap.expandProduceNameSelectId;

            if (zmnUtil.isNotEmptyNull(expandProduceTypeSelectId)) {
                selectMethods.selectExpandProduceType(expandProduceTypeSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择品牌类型-"
                });
            }
            if (zmnUtil.isNotEmptyNull(expandProduceNameSelectId)) {
                selectMethods.selectExpandProduceName(expandProduceNameSelectId, {
                    isReload: false,
                    tips: "-选择品牌名称-"
                });
            }
            return zmnSelect.selectBoxes({
                expandProduceTypeSelectId: {
                    id: expandProduceTypeSelectId,
                    sn: 1,
                },
                expandProduceNameSelectId: {
                    id: expandProduceNameSelectId,
                    sn: 2,
                },
            }, optionsMap, commonOptions);
        },
        /**
         * 推广品牌类型
         * @param selectId
         * @param options
         * @returns {xmSelect对象}
         */
        selectExpandProduceType: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "value",
                    value: "code",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/market/api/listBrandType',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {}, newExtendParams);
                        }
                    }
                }
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 推广品牌名称
         * @param selectId
         * @param options
         * @returns {xmSelect对象}
         */
        selectExpandProduceName: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "brandName",
                    value: "brandId",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/market/api/listBrandByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let brandType = null;
                            if (zmnUtil.isArray(prevValues)) {
                                brandType = prevValues[0];
                            }
                            return $.extend(true, {}, {dio: {brandType: brandType, status: 2}}, newExtendParams);
                        }
                    }
                }
            })
            return zmnSelect.selectBox(selectId, newOptions);
        },


        /**
         * 录单部门
         * @param selectId 页面的下拉对象ID
         * @param options  自定属性
         */
        selectOrganizeDeptEntryOrder: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                data: [
                    {"deptId": 1003, "deptName": "战略中心"},
                    {"deptId": 1006, "deptName": "渠道中心"},
                    {"deptId": 1009, "deptName": "营销中心"},
                    {"deptId": 1010, "deptName": "订单中心"},
                    {"deptId": 4387, "deptName": "用户中心"}
                ],
                selectedValues: [], //已选中值（用于回显),格式：[value1,value2],
                propMap: {  //选项参数映射配置
                    name: "deptName",   //显示值
                    value: "deptId"  //选中值
                },
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 产品分组下拉
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "bizTypeList": null, //业务类型（必填）：Integer集合类型；
         *                  "status": null // 状态：Integer类型；null不限；
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        selectProductGroup: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/product/api/product/group/listOtionByBizType',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return newExtendParams;
                        }, dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 业务线下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "bizType": null, //业务类型（必填）：Integer集合类型；
         *                }
         *             }
         *         }
         *     }
         * }
         */
        selectBizLine: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/product/api/business/listOption',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                status: 2,
                            }, newExtendParams);
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 入口分类下拉框
         * @param selectId
         * @param options
         */
        selectEntranceType: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/common_data/api/listAllGateType',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {
                                status: 2,
                            }, newExtendParams);
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 入口下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "type": null, //入口类型（必填）：Integer集合类型；
         *                }
         *             }
         *         }
         *     }
         * }
         */
        selectEntrance: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/common_data/api/listGateByType',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return newExtendParams;
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },

        /**
         * 供应商
         * @param selectId
         * @param options
         * @returns {xmSelect对象}
         */
        selectlSuppliers: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/scm2/common/option/listSupplier',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return newExtendParams;
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         *  子公司/供应链仓库联动下拉
         * @param selectIdMap 页面的下拉对象ID集合
         * @param optionsMap   自定属性集合
         * @param commonOptions 公共自定义属性
         */
        selectlWarehouses: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};
            let orgThrSelectId  = selectIdMap.orgThrSelectId ;
            let warehouseSelectId = selectIdMap.warehouseSelectId;

            if (zmnUtil.isNotEmptyNull(orgThrSelectId )) {
                selectMethods.selectSubCompany(orgThrSelectId , {
                    isReload: false,
                    tips: "-选择子公司-",
                    remote: {
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return {plat: 10};
                            }
                        }
                    }
                })
            }
            if (zmnUtil.isNotEmptyNull(warehouseSelectId)) {
                selectMethods.selectlBaseWarehouse(warehouseSelectId, {isReload: false});
            } else {
                selectMethods.selectlBaseWarehouse(warehouseSelectId, {
                    isReload: false, remote: {
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return {plat: 10};
                            }
                        }
                    }
                });
            }

            return zmnSelect.selectBoxes({
                orgThrSelectId: {
                    id: orgThrSelectId,
                    sn: 1,
                },
                warehouseSelectId: {
                    id: warehouseSelectId,
                    sn: 2,
                },
            }, optionsMap, commonOptions);

        },
        /**
         * 供应链仓库下拉
         * @param selectId 页面的下拉对象ID
         * @param options 自定属性
         * @returns {xmSelect对象}
         */
        selectlBaseWarehouse: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                isRadio: false,
                tips: "-选择仓库-",
                propMap: {
                    name: "label",
                    value: "value"
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/scm2/common/option/listWarehouseBySubCompanyId',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let subCompanyIds = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues : null;
                            return $.extend(true, {}, {subCompanyIds: subCompanyIds}, newExtendParams);
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 供应链产品类型
         * @param selectId
         * @param options
         * @returns {xmSelect对象}
         */
        selectlScmProductTypes: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/scm2/common/option/listGoodsType',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return newExtendParams;
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         *  供应链产品一级分类/产品二级分类联动下拉
         * @param selectIdMap 页面的下拉对象ID集合
         * @param optionsMap   自定属性集合
         * @param commonOptions 公共自定义属性
         */
        selectlScmCategories: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};
            let categOneSelectId = selectIdMap.categOneSelectId;
            let categTwoSelectId = selectIdMap.categTwoSelectId;

            if (zmnUtil.isNotEmptyNull(categOneSelectId)) {
                selectMethods.selectlScmCategorie(categOneSelectId, {
                    isReload: false,
                    tips: "-一级分类-",
                    remote: {
                        enable: true,
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return {queryDIO: {"parentIds": [1]}};
                            },
                        }
                    }
                })
            }
            if (zmnUtil.isNotEmptyNull(categTwoSelectId)) {
                selectMethods.selectlScmCategorie(categTwoSelectId, {
                    isReload: false,
                    tips: "-二级分类-",
                    remote: {
                        enable: true,
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return {queryDIO: {"parentIds": prevValues}};
                            },
                        }
                    }
                });
            }

            return zmnSelect.selectBoxes({
                categOneSelectId: {
                    id: categOneSelectId,
                    sn: 1,
                },
                categTwoSelectId: {
                    id: categTwoSelectId,
                    sn: 2,
                },
            }, optionsMap, commonOptions);

        },
        /**
         * 供应链产品分类
         * @param selectId
         * @param options
         * @returns {xmSelect对象}
         */
        selectlScmCategorie: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                isRadio: false,
                propMap: {
                    name: "label",
                    value: "value"
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/scm2/common/option/listGoodsCategoryByParentIdsAndStatus',
                    events: {
                        params: function (searchValue, limitPermit, pageIndex) {
                            return {queryDIO: {status: 2}};
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        },
        /**
         * 供应链搜索产品下拉
         * @param selectId 页面的下拉对象ID
         * @param options 自定属性
         */
        searchScmProducts: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                isRadio: false,
                propMap: {
                    name: "label",
                    value: "value"
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/scm2/common/option/listGoodsByNameAndStatus',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return $.extend(true, {}, {status: 2}, newExtendParams);
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            return {name: searchValue}
                        }
                    }
                }
            });
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 供应链产品品牌
         * @param selectId 页面的下拉对象ID
         * @param options 自定属性
         * @returns {xmSelect对象}
         */
        selectlScmBrands: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                isRadio: false,
                tips: "-选择SCM产品品牌-",
                propMap: {
                    name: "label",
                    value: "value"
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/scm2/common/option/listBrand',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return newExtendParams;
                        }
                    }
                }
            });
            return zmnSelect.selectBox(selectId, newOptions);
        }


    }

    let selectlMethods = {
        /**
         * 平台/大区/公司下拉框联动（支持平台/大区、大区/子公司下拉框联动）
         * @param platSelectId
         * @param orgTwoSelectId
         * @param orgThrSelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see zmnSelect.selectlOrganizes
         */
        selectlPlatRegionCompany: function (platSelectId, orgTwoSelectId, orgThrSelectId, optionsMap, commonOptions) {
            return this.selectlOrganizes({
                platSelectId: platSelectId,
                orgTwoSelectId: orgTwoSelectId,
                orgThrSelectId: orgThrSelectId,
            }, optionsMap, commonOptions);
        },

        /**
         * 组织机构级联下拉框：平台/大区/子公司
         * 子级联下拉框：
         *  平台/大区
         *  大区（初始化时指定parentId）/子公司
         *  平台/子公司
         * @param selectIdMap 格式:
         * {
         *     platSelectId: null, //平台ID
         *     orgTwoSelectId: null, //大区ID
         *     orgThrSelectId: null, //子公司ID
         * }
         * @param optionsMap
         * orgTwoSelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "parentId": null, //父级ID（平台ID为空时必填）：Integer类型；
         *                }
         *             }
         *         }
         *     }
         * }
         * @param commonOptions
         */
        selectlOrganizes: function (selectIdMap, optionsMap, commonOptions) {

            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};

            let platSelectId = selectIdMap.platSelectId;
            let orgTwoSelectId = selectIdMap.orgTwoSelectId;
            let orgThrSelectId = selectIdMap.orgThrSelectId;

            if (zmnUtil.isNotEmptyNull(platSelectId)) {
                selectMethods.selectPlat(platSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择平台-",
                });
            }

            if (zmnUtil.isNotEmptyNull(orgTwoSelectId)) {
                selectMethods.selectChildrenOrganize(orgTwoSelectId, {
                    isReload: false,
                    isRadio: zmnUtil.isNotEmptyNull(orgThrSelectId) ? true : false,
                    tips: "-选择大区-",
                })
            }

            if (zmnUtil.isNotEmptyNull(orgThrSelectId)) {
                selectMethods.selectOrganize(orgThrSelectId, {
                    tips: "-选择子公司-",
                    isReload: false,
                    remote: {
                        events: {
                            extendParams: function () {
                                let platIds = zmnSelect.getSelectedValue(platSelectId);
                                return {
                                    plat: zmnUtil.isArray(platIds) && platIds.length > 0 ? platIds[0] : null,
                                    parentIdList: zmnSelect.getSelectedValue(orgTwoSelectId),
                                    level: 3,
                                }
                            }
                        }
                    }
                });
            }

            return zmnSelect.selectBoxes({
                platSelectId: {
                    id: platSelectId,
                    sn: 1,
                },
                orgTwoSelectId: {
                    id: orgTwoSelectId,
                    sn: 2,
                },
                orgThrSelectId: {
                    id: orgThrSelectId,
                    sn: 3,
                },
            }, optionsMap, commonOptions);
        },

        /**
         * 部门级联下拉框：1级部门/2级部门/3级部门
         * 子级联下拉框：
         *  1级部门/2级部门
         *  2级部门/3级部门
         * @param selectIdMap 格式:
         * {
         *     deptOneSelectId: null, //1级部门ID
         *     deptTwoSelectId: null, //2级部门ID
         *     deptThrSelectId: null, //3级部门ID
         * }
         * @param optionsMap
         * 通用附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "orgId": null, //组织ID：Integer类型，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @param commonOptions
         */
        selectlOrganizeDepts: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};
            let deptOneSelectId = selectIdMap.deptOneSelectId;
            let deptTwoSelectId = selectIdMap.deptTwoSelectId;
            let deptThrSelectId = selectIdMap.deptThrSelectId;

            if (zmnUtil.isNotEmptyNull(deptOneSelectId)) {
                selectMethods.selectOrganizeDept(deptOneSelectId, {
                    isReload: false,
                    tips: "-选择一级部门-",
                    remote: {
                        events: {
                            extendParams: function () {
                                return {
                                    level: 1,
                                }
                            }
                        }
                    }
                });
            }
            if (zmnUtil.isNotEmptyNull(deptTwoSelectId)) {
                selectMethods.selectOrganizeDept(deptTwoSelectId, {
                    isReload: false,
                    tips: "-选择二级部门-",
                    remote: {
                        events: {
                            extendParams: function () {
                                return {
                                    level: 2,
                                }
                            }
                        }
                    }
                });
            }
            if (zmnUtil.isNotEmptyNull(deptThrSelectId)) {
                selectMethods.selectOrganizeDept(deptThrSelectId, {
                    isReload: false,
                    tips: "-选择三级部门-",
                    remote: {
                        events: {
                            extendParams: function () {
                                return {
                                    level: 3,
                                }
                            }
                        }
                    }
                });
            }
            return zmnSelect.selectBoxes({
                deptOneSelectId: {
                    id: deptOneSelectId,
                    sn: 1,
                },
                deptTwoSelectId: {
                    id: deptTwoSelectId,
                    sn: 2,
                },
                deptThrSelectId: {
                    id: deptThrSelectId,
                    sn: 3,
                },
            }, optionsMap, commonOptions);
        },

        /**
         * 平台/公司下拉框联动
         * @param platSelectId
         * @param companySelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * companySelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "type": null, //公司类型：Integer类型；
         *                }
         *             }
         *         }
         *     }
         * }
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         */
        selectlPlatCompany: function (platSelectId, companySelectId, optionsMap, commonOptions) {
            selectMethods.selectPlat(platSelectId, {
                isReload: false,
                isRadio: true,
                tips: "-选择平台-",
            });
            selectMethods.selectSubCompany(companySelectId, {
                isReload: false,
                tips: "-选择子公司-",
                remote: {
                    events: {
                        extendParams: function (prevValues) {
                            return {
                                plat: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null,
                                type: null,
                            }
                        }
                    }
                }
            });
            return zmnSelect.selectBoxes({
                platSelectId: {
                    id: platSelectId,
                    sn: 1,
                },
                companySelectId: {
                    id: companySelectId,
                    sn: 2,
                }
            }, optionsMap, commonOptions);
        },
        /**
         * 平台/子公司/服务商 联动
         * @param selectIdMap {platSelectId:平台ID,subCompanySelectId:子公司ID,spCompanySelectId:服务商ID}
         * @param optionsMap 请求参数
         * @param commonOptions 公共请求参数
         */
        selectPlatSubCompanySpCompany: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};

            let platSelectId = selectIdMap.platSelectId;
            let subCompanySelectId = selectIdMap.subCompanySelectId;
            let spCompanySelectId = selectIdMap.spCompanySelectId;

            if (zmnUtil.isNotEmptyNull(platSelectId)) {
                selectMethods.selectPlat(platSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择平台-",
                });
            }
            if (zmnUtil.isNotEmptyNull(subCompanySelectId)) {
                selectMethods.selectSubCompany(subCompanySelectId, {
                    isReload: false,
                    isRadio: zmnUtil.isNotEmptyNull(platSelectId) ? true : false,
                    tips: "-选择子公司-",
                    remote: {
                        events: {
                            extendParams: function (prevValues) {
                                return {
                                    plat: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null
                                }
                            }
                        }
                    }
                });
            }
            if (zmnUtil.isNotEmptyNull(spCompanySelectId)) {
                selectMethods.selectSpCompany(spCompanySelectId, {
                    tips: "-选择服务公司-",
                    isReload: false,
                    page: { //分配配置
                        enable: true,  //开关：true-开启；false-关闭
                        pageSize: 100,   //分页
                    },
                    remote: {
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return $.extend(true, {}, {
                                    pageSize: 10000,
                                    subCompanyIds: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues : null
                                }, newExtendParams);
                            }
                        }
                    }
                });
            }

            return zmnSelect.selectBoxes({
                platSelectId: {
                    id: platSelectId,
                    sn: 1,
                },
                subCompanySelectId: {
                    id: subCompanySelectId,
                    sn: 2,
                },
                spCompanySelectId: {
                    id: spCompanySelectId,
                    sn: 3,
                },
            }, optionsMap, commonOptions);
        },
        /**
         * 大区/子公司/服务商下拉框联动
         * @param orgTwoSelectId
         * @param orgThrSelectId
         * @param spCompanySelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * orgTwoSelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                      "parentId": 20, //平台标识(必填)：Integer类型；
         *                }
         *             }
         *         }
         *     }
         * }
         * spCompanySelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "type": 10, //服务商类型：Integer类型；10服务商(包括信息公司和服务商)，11信息公司，12服务商，20信息公司和电器公司，21电器公司, null不限
         *                  "status": 2, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see 推荐使用 zmnSelect.selectlOrganizes + zmnSelect.searchSpCompany
         */
        selectlRegionSubCompanySpCompany: function (orgTwoSelectId, orgThrSelectId, spCompanySelectId, optionsMap, commonOptions) {

            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};

            this.selectlOrganizes({
                orgTwoSelectId: orgTwoSelectId,
                orgThrSelectId: orgThrSelectId,
            }, optionsMap);

            optionsMap[spCompanySelectId] = zmnSelect.mergeOptions(spCompanySelectId, optionsMap[spCompanySelectId], {
                tips: "-选择服务公司-",
                propMap: {
                    name: "label",
                    value: "value"
                },
                remote: {
                    enable: true,
                    url: GATEWAY_API_BASE + '/common_data/api/company/listOptionPageByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let companyId = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null;
                            let defaultParams = {orgThrId: companyId};
                            let types = convertCompanyType(newExtendParams.type);
                            if (types.length > 0) {
                                defaultParams.companyTypeQueryList = types;
                                delete newExtendParams.type;
                            }
                            return {
                                query: $.extend(true, {}, defaultParams, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                query: {
                                    limitPermit: limitPermit === true
                                }
                            };
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            });
            return zmnSelect.selectBoxes({
                orgTwoSelectId: {
                    id: orgTwoSelectId,
                    sn: 1,
                },
                orgThrSelectId: {
                    id: orgThrSelectId,
                    sn: 2
                },
                spCompanySelectId: {
                    id: spCompanySelectId,
                    sn: 3
                }
            }, optionsMap, commonOptions);
        },
        /**
         * 子公司/城市下拉框联动
         * @param subCompanySelectId
         * @param citySelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * subCompanySelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                      "plat": 2, //平台标识(必填)：Integer类型；
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see zmnSelect.selectlSubCompaniesCity
         */
        selectlSubCompanyCity: function (subCompanySelectId, citySelectId, optionsMap, commonOptions) {
            return this.selectlSubCompaniesCity({
                subCompanySelectId: subCompanySelectId,
                citySelectId: citySelectId,
            }, optionsMap, commonOptions);
        },


        /**
         * 子公司/服务商/城市下拉框联动（支持子公司/服务商、服务商/城市下拉框联动）
         * @param subCompanySelectId
         * @param spCompanySelectId
         * @param citySelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * subCompanySelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": 2, //平台标识(必填)：Integer类型；
         *                }
         *             }
         *         }
         *     }
         * }
         * spCompanySelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": 2, //平台标识：Integer类型；，null不限
         *                  "type": null, //服务商类型：Integer类型；10服务商(包括信息公司和服务商)，11信息公司，12服务商，20信息公司和电器公司，21电器公司, null不限
         *                  "regionId": null, //大区的组织架构Id：Integer类型；null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see zmnSelect.selectlSubCompaniesCity
         */
        selectlSubCompanySpCompanyCity: function (subCompanySelectId, spCompanySelectId, citySelectId, optionsMap, commonOptions) {
            return this.selectlSubCompaniesCity({
                subCompanySelectId: subCompanySelectId,
                spCompanySelectId: spCompanySelectId,
                citySelectId: citySelectId,
            }, optionsMap, commonOptions);
        },

        /**
         * 公司城市级联下拉框：子公司/服务公司/城市
         * 子级联下拉框：
         *      子公司/服务商
         *      子公司/城市
         *      服务商/城市
         * @param selectIdMap 格式：
         * {
         *      subCompanySelectId: null, //子公司ID
         *      spCompanySelectId: null, //服务商ID
         *      citySelectId: null, //城市ID
         * }
         * @param optionsMap
         * subCompanySelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；
         *                }
         *             }
         *         }
         *     }
         * }
         * spCompanySelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "type": null, //类型：100平台公司，110大区，120子公司，130服务商，140电器公司，200渠道，220企业客户，230厂商客户，300支付平台，310配件供应商，320整机供应商，330配送供应商, null不限
         *                  "regionId": null, //大区的组织架构Id：Integer类型；null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @param commonOptions
         */
        selectlSubCompaniesCity: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};

            let subCompanySelectId = selectIdMap.subCompanySelectId;
            let spCompanySelectId = selectIdMap.spCompanySelectId;
            let citySelectId = selectIdMap.citySelectId;

            if (zmnUtil.isNotEmptyNull(subCompanySelectId)) {
                selectMethods.selectSubCompany(subCompanySelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择子公司-",
                });
            }

            if (zmnUtil.isNotEmptyNull(spCompanySelectId)) {

                let selectKey = "spCompanySelectId";
                if (optionsMap.hasOwnProperty(spCompanySelectId)) {
                    selectKey = spCompanySelectId;
                }

                optionsMap[selectKey] = zmnSelect.mergeOptions(spCompanySelectId, optionsMap[selectKey], {
                    tips: "-选择服务公司-",
                    isRadio: zmnUtil.isNotEmptyNull(citySelectId) ? true : false,
                    propMap: {
                        name: "label",
                        value: "value",
                    },
                    remote: {
                        enable: true,
                        url: GATEWAY_API_BASE + '/common_data/api/company/listOptionPageByQuery',
                        events: {
                            params: function (searchValue, limitPermit, pageIndex) {
                                return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                    query: {
                                        limitPermit: limitPermit === true
                                    }
                                };
                            },
                            extendParams: function (prevValues, newExtendParams) {
                                let companyIds = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues : null;
                                let defaultParams = {subCompanyIds: companyIds};
                                let types = convertCompanyType(newExtendParams.type);
                                if (types.length > 0) {
                                    defaultParams.companyTypeQueryList = types;
                                    delete newExtendParams.type;
                                }
                                if (zmnUtil.isNotEmptyNull(newExtendParams.regionId)) {
                                    defaultParams.orgTwoId = newExtendParams.regionId;
                                    delete newExtendParams.regionId;
                                }
                                return {
                                    query: $.extend(true, {
                                        status: 2
                                    }, defaultParams, newExtendParams)
                                };
                            },
                            dataMap: function (resultData) {
                                let data = [];
                                if (resultData.status == 200) {
                                    data = resultData.data.options;
                                }
                                return {
                                    data: data
                                };
                            }
                        }
                    }
                });
            }

            if (zmnUtil.isNotEmptyNull(citySelectId)) {
                let selectKey = "citySelectId";
                if (optionsMap.hasOwnProperty(citySelectId)) {
                    selectKey = citySelectId;
                }
                if (zmnUtil.isNotEmptyNull(spCompanySelectId)) {
                    //根据服务商查询城市
                    optionsMap[selectKey] = zmnSelect.mergeOptions(citySelectId, optionsMap[selectKey], {
                        tips: "-选择城市-",
                        remote: {
                            enable: true,
                            url: GATEWAY_API_BASE + '/sp/api/listAvailableAreaBySpId',
                            events: {
                                extendParams: function (prevValues, newExtendParams) {
                                    let manageCompanyId = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null;
                                    return $.extend(true, {}, {
                                        spId: manageCompanyId,
                                        areaLevel: "CITY"
                                    }, newExtendParams)
                                }
                            }
                        }
                    })
                } else {
                    //根据子公司查询城市
                    optionsMap[selectKey] = zmnSelect.mergeOptions(citySelectId, optionsMap[selectKey], {
                        tips: "-选择城市-",
                        page: { //分配配置
                            enable: true,  //开关：true-开启；false-关闭
                        },
                        remote: {
                            enable: true,
                            url: GATEWAY_API_BASE + '/sp/api/listCityVtByCompanyId',
                            events: {
                                extendParams: function (prevValues, newExtendParams) {
                                    let subCompanyId = zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null;
                                    return $.extend(true, {}, {
                                        companyId: subCompanyId
                                    }, newExtendParams)
                                }
                            }
                        }
                    })
                }
            }

            return zmnSelect.selectBoxes({
                subCompanySelectId: {
                    id: subCompanySelectId,
                    sn: 1,
                },
                spCompanySelectId: {
                    id: spCompanySelectId,
                    sn: 1,
                },
                citySelectId: {
                    id: citySelectId,
                    sn: 1,
                }
            }, optionsMap, commonOptions);
        },

        /**
         * 省份/城市/区县下拉框联动（支持省份/城市、城市/区县下拉框联动）
         * @param provinceSelectId
         * @param citySelectId
         * @param countySelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see zmnSelect.selectlAreas
         */
        selectlArea: function (provinceSelectId, citySelectId, countySelectId, optionsMap, commonOptions) {
            return this.selectlAreas({
                provinceSelectId: provinceSelectId,
                citySelectId: citySelectId,
                countySelectId: countySelectId,
            }, optionsMap, commonOptions)
        },
        /**
         * 行政区域级联下拉框：省/市/区
         * 子级联下拉框：
         *      省/市
         *      市/区
         * @param selectIdMap   格式:
         *  {
         *      provinceSelectId: null, //省份ID
         *      citySelectId: null, //城市ID
         *      countySelectId: null, //区县ID
         *  }
         * @param optionsMap
         * citySelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "provinceId": null, //省份ID：Integer类型；null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @param commonOptions
         */
        selectlAreas: function (selectIdMap, optionsMap, commonOptions) {

            let provinceSelectId = selectIdMap.provinceSelectId;
            let citySelectId = selectIdMap.citySelectId;
            let countySelectId = selectIdMap.countySelectId;

            if (zmnUtil.isNotEmptyNull(provinceSelectId)) {
                selectMethods.selectProvince(provinceSelectId, {
                    tips: "-选择省份-",
                    isReload: false,
                    isRadio: true,
                });
            }
            if (zmnUtil.isNotEmptyNull(citySelectId)) {
                if (zmnUtil.isNotEmptyNull(provinceSelectId)) {
                    selectMethods.selectCity(citySelectId, {
                        tips: "-选择城市-",
                        isReload: false,
                        isRadio: zmnUtil.isNotEmptyNull(countySelectId) ? true : false,
                        propMap: {
                            name: "label",
                            value: "value",
                        },
                        remote: {
                            enable: true,
                            url: GATEWAY_API_BASE + '/common_data/api/listAreaOptionByParentIdsAndLevel',
                            events: {
                                params: function (searchValue, limitPermit, pageIndex) {
                                    return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                        query: {
                                            limitPermit: limitPermit === true
                                        }
                                    };
                                },
                                extendParams: function (prevValues, newExtendParams) {
                                    return {
                                        query: $.extend(true, {}, {
                                            parentIdList: prevValues,
                                            level: 3
                                        }, newExtendParams)
                                    };
                                },
                                dataMap: function (resultData) {
                                    let data = [];
                                    if (resultData.status == 200) {
                                        data = resultData.data.options;
                                    } else {
                                        console.log(resultData.message);
                                    }
                                    return {
                                        data: data
                                    };
                                }
                            }
                        }
                    });
                } else {
                    selectMethods.selectCity(citySelectId, {
                        tips: "-选择城市-",
                        isReload: false,
                        isRadio: zmnUtil.isNotEmptyNull(countySelectId) ? true : false,
                    });
                }
            }
            if (zmnUtil.isNotEmptyNull(countySelectId)) {
                selectMethods.selectCounty(countySelectId, {
                    tips: "-选择区县-",
                    isReload: false,
                });
            }
            return zmnSelect.selectBoxes({
                provinceSelectId: {
                    id: provinceSelectId,
                    sn: 1,
                },
                citySelectId: {
                    id: citySelectId,
                    sn: 2,
                },
                countySelectId: {
                    id: countySelectId,
                    sn: 3,
                }
            }, optionsMap, commonOptions);
        },

        /**
         * 行政区域级联下拉框：省/市/区/网格
         * 子级联下拉框：
         *      省/市
         *      市/区
         *      区/网格
         * @param selectIdMap   格式:
         *  {
         *      provinceSelectId: null, //省份ID
         *      citySelectId: null, //城市ID
         *      countySelectId: null, //区县ID
         *  }
         * @param optionsMap  参数
         * @param commonOptions 公共参数
         */
        selectlGrid: function (selectIdMap, optionsMap, commonOptions) {
            let provinceSelectId = selectIdMap.provinceSelectId;
            let citySelectId = selectIdMap.citySelectId;
            let countySelectId = selectIdMap.countySelectId;
            let gridSelectId = selectIdMap.gridSelectId;
            if (zmnUtil.isNotEmptyNull(provinceSelectId)) {
                selectMethods.selectProvince(provinceSelectId, {
                    tips: "-选择省份-",
                    isReload: false,
                    isRadio: true,
                });
            }
            if (zmnUtil.isNotEmptyNull(provinceSelectId)) {
                selectMethods.selectCity(citySelectId, {
                    tips: "-选择城市-",
                    isReload: false,
                    isRadio: zmnUtil.isNotEmptyNull(countySelectId) ? true : false,
                    propMap: {
                        name: "label",
                        value: "value",
                    },
                    remote: {
                        enable: true,
                        url: GATEWAY_API_BASE + '/common_data/api/listAreaOptionByParentIdsAndLevel',
                        events: {
                            params: function (searchValue, limitPermit, pageIndex) {
                                return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                    query: {
                                        limitPermit: limitPermit === true
                                    }
                                };
                            },
                            extendParams: function (prevValues, newExtendParams) {
                                return $.extend(true, {}, {
                                    query: {parentIdList: prevValues, level: 3}
                                }, newExtendParams)
                            },
                            dataMap: function (resultData) {
                                let data = [];
                                if (resultData.status == 200) {
                                    data = resultData.data.options;
                                } else {
                                    console.log(resultData.message);
                                }
                                return {
                                    data: data
                                };
                            }
                        }
                    }
                });
            } else {
                selectMethods.selectCity(citySelectId, {
                    tips: "-选择城市-",
                    isReload: false,
                    isRadio: zmnUtil.isNotEmptyNull(countySelectId) ? true : false,
                });
            }
            if (zmnUtil.isNotEmptyNull(countySelectId)) {
                selectMethods.selectCounty(countySelectId, {
                    tips: "-选择区县-",
                    isReload: false,
                    isRadio: true,
                });
            }
            if (zmnUtil.isNotEmptyNull(gridSelectId)) {
                let options = $.extend(true, {
                    tips: "-选择网格-",
                    isReload: false,
                    isRadio: true,
                }, optionsMap.gridSelectId);
                selectMethods.selectGrid(gridSelectId, countySelectId, options);
            }
            return zmnSelect.selectBoxes({
                provinceSelectId: {
                    id: provinceSelectId,
                    sn: 1,
                },
                citySelectId: {
                    id: citySelectId,
                    sn: 2,
                },
                countySelectId: {
                    id: countySelectId,
                    sn: 3,
                },
                gridSelectId: {
                    id: gridSelectId,
                    sn: 4,
                }
            }, optionsMap, commonOptions);
        },

        /**
         * 订单级联下拉框： 跟单类型/内容/缘由
         *
         * @param selectIdMap   格式:
         *  {
         *      typeSelectId: null, //跟单类型ID
         *      contentSelectId: null, //内容ID
         *      reasonSelectId: null, //缘由ID
         *  }
         * @param optionsMap  参数
         * @param commonOptions 公共参数
         */
        selectTrackCategories: function (selectIdMap, optionsMap, commonOptions) {
            let typeSelectId = selectIdMap.typeSelectId;
            let contentSelectId = selectIdMap.contentSelectId;
            let reasonSelectId = selectIdMap.reasonSelectId;
            if (zmnUtil.isNotEmptyNull(typeSelectId)) {
                selectMethods.selectOrderTrackType(typeSelectId, {
                    tips: "-选择跟单类型-",
                    isReload: false,
                    isRadio: false,
                });
            }
            if (zmnUtil.isNotEmptyNull(contentSelectId)) {
                selectMethods.selectOrderTrackContent(contentSelectId, {
                    tips: "-选择内容-",
                    isReload: false,
                    isRadio: false,
                });
            }
            if (zmnUtil.isNotEmptyNull(reasonSelectId)) {
                selectMethods.selectOrderTrackReason(reasonSelectId, {
                    tips: "-选择缘由-",
                    isReload: false,
                    isRadio: false,
                });
            }

            return zmnSelect.selectBoxes({
                typeSelectId: {
                    id: typeSelectId,
                    sn: 1,
                },
                contentSelectId: {
                    id: contentSelectId,
                    sn: 2,
                },
                reasonSelectId: {
                    id: reasonSelectId,
                    sn: 3,
                }
            }, optionsMap, commonOptions);
        },


        /**
         * 服务分类/1级业务产品分类/2级业务产品分类下拉框联动（支持服务分类/1级业务产品分类，1级业务产品分类/2级业务产品分类下拉框联动）（不支持数据权限）
         * @param servCategSelectId
         * @param erpCategOneSelectId
         * @param erpCategTwoSelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see zmnSelect.selectlErpProdCategories
         */
        selectlServiceCategoryErpProdCategory: function (servCategSelectId, erpCategOneSelectId, erpCategTwoSelectId, optionsMap, commonOptions) {
            return this.selectlErpProdCategories({
                servCategSelectId: servCategSelectId, // 服务分类ID
                erpCategOneSelectId: erpCategOneSelectId, // 1级业务产品分类ID
                erpCategTwoSelectId: erpCategTwoSelectId, // 2级业务产品分类ID
            }, optionsMap, commonOptions);
        },
        /**
         * 业务产品分类级联下拉框: 服务分类/1级业务产品分类/2级业务产品分类
         * 子级联下拉框：
         *      服务分类/1级业务产品分类
         *      1级业务产品分类/2级业务产品分类
         * @param selectIdMap 格式：{
         *      servCategSelectId: null, // 服务分类ID
         *      erpCategOneSelectId: null, // 1级业务产品分类ID
         *      erpCategTwoSelectId: null, // 2级业务产品分类ID
         * }
         * @param optionsMap
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         */
        selectlErpProdCategories: function (selectIdMap, optionsMap, commonOptions) {

            let servCategSelectId = selectIdMap.servCategSelectId;
            let erpCategOneSelectId = selectIdMap.erpCategOneSelectId;
            let erpCategTwoSelectId = selectIdMap.erpCategTwoSelectId;

            if (zmnUtil.isNotEmptyNull(servCategSelectId)) {
                selectMethods.selectServiceCategory(servCategSelectId, {
                    isRadio: true,
                    isReload: false,
                    tips: "-选择服务分类-",
                    remote: {
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return {
                                    showType: 1
                                }
                            }
                        }
                    }
                });
            }
            if (zmnUtil.isNotEmptyNull(erpCategOneSelectId)) {
                if (zmnUtil.isNotEmptyNull(servCategSelectId)) {
                    selectMethods.selectProdCategOne(erpCategOneSelectId, {
                        tips: "-选择一级业务产品分类-",
                        isReload: false,
                        remote: {
                            events: {
                                extendParams: function (prevValues) {
                                    return {
                                        parentIds: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues : null,
                                        showType: 1,
                                        level: 1
                                    }
                                }
                            }
                        }
                    })
                } else {
                    selectMethods.selectErpCategOne(erpCategOneSelectId, {
                        tips: "-选择一级业务产品分类-",
                        isReload: false,
                    });
                }
            }
            if (zmnUtil.isNotEmptyNull(erpCategTwoSelectId)) {
                selectMethods.selectProdCategTwo(erpCategTwoSelectId, {
                    tips: "-选择二级业务产品分类-",
                    isReload: false,
                    remote: {
                        events: {
                            extendParams: function (prevValues) {
                                let parentIds = prevValues;
                                if (zmnUtil.isNotEmptyNull(servCategSelectId) && zmnUtil.isEmptyNull(erpCategOneSelectId)) {
                                    let values1 = zmnSelect.getSelectedValue(servCategSelectId);
                                    parentIds = zmnUtil.isArray(values1) && values1.length > 0 ? values1 : null;
                                }
                                return {
                                    parentIds: parentIds,
                                    showType: 1,
                                    level: 2
                                }
                            }
                        }
                    }
                })
            }
            return zmnSelect.selectBoxes({
                servCategSelectId: {
                    id: servCategSelectId,
                    sn: 1,
                },
                erpCategOneSelectId: {
                    id: erpCategOneSelectId,
                    sn: 2,
                },
                erpCategTwoSelectId: {
                    id: erpCategTwoSelectId,
                    sn: 3
                }
            }, optionsMap, commonOptions);
        },
        /**
         * 服务分类/1级前台产品分类/2级前台产品分类下拉框联动（支持服务分类/1级前台产品分类，1级前台产品分类/2级前台产品分类下拉框联动）（不支持数据权限）
         * @param servCategSelectId
         * @param ecCategOneSelectId
         * @param ecCategTwoSelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see zmnSelect.selectlEcProdCategories
         */
        selectlServCategoryEcProdCategory: function (servCategSelectId, ecCategOneSelectId, ecCategTwoSelectId, optionsMap, commonOptions) {
            return this.selectlEcProdCategories({
                servCategSelectId: servCategSelectId,
                ecCategOneSelectId: ecCategOneSelectId,
                ecCategTwoSelectId: ecCategTwoSelectId,
            }, optionsMap, commonOptions);
        },
        /**
         * 前台产品分类级联下拉框: 服务分类/1级前台产品分类/2级前台产品分类
         * 子级联下拉框：
         *      服务分类/1级前台产品分类
         *      1级前台产品分类/2级前台产品分类
         * @param selectIdMap 格式：
         * {
         *     servCategSelectId: null, //服务分类ID
         *     ecCategOneSelectId: null, //1级前台产品分类ID
         *     ecCategTwoSelectId: null, //2级前台产品分类ID
         * }
         * @param optionsMap
         * @param commonOptions
         * @return {xmSelect对象Map，格式：}
         */
        selectlEcProdCategories: function (selectIdMap, optionsMap, commonOptions) {

            let servCategSelectId = selectIdMap.servCategSelectId;
            let ecCategOneSelectId = selectIdMap.ecCategOneSelectId;
            let ecCategTwoSelectId = selectIdMap.ecCategTwoSelectId;

            if (zmnUtil.isNotEmptyNull(servCategSelectId)) {
                selectMethods.selectServCategory(servCategSelectId, {
                    tips: "-选择服务分类-",
                    isReload: false,
                    isRadio: true,
                    remote: {
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return {
                                    showType: 2
                                }
                            },
                            dataMap: function (resultData) {
                                let data = [];
                                if (resultData.status == 200) {
                                    data = resultData.data.options;
                                } else {
                                    console.log(resultData.message);
                                }
                                return {
                                    data: data
                                };
                            }
                        }
                    }
                });
            }
            if (zmnUtil.isNotEmptyNull(ecCategOneSelectId)) {
                if (zmnUtil.isNotEmptyNull(servCategSelectId)) {
                    selectMethods.selectProdCategOne(ecCategOneSelectId, {
                        tips: "-选择一级前台产品分类-",
                        isReload: false,
                        remote: {
                            events: {
                                extendParams: function (prevValues) {
                                    return {
                                        parentIds: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues : null,
                                        showType: 2,
                                        level: 1
                                    }
                                }
                            }
                        }
                    });
                } else {
                    selectMethods.selectEcCategOne(ecCategOneSelectId, {
                        isReload: false,
                        tips: "-选择一级前台产品分类-"
                    });
                }
            }
            if (zmnUtil.isNotEmptyNull(ecCategTwoSelectId)) {
                selectMethods.selectProdCategTwo(ecCategTwoSelectId, {
                    tips: "-选择二级前台产品分类-",
                    isReload: false,
                    remote: {
                        events: {
                            extendParams: function (prevValues) {
                                let servCategId = prevValues;
                                if (zmnUtil.isNotEmptyNull(servCategSelectId)) {
                                    let values1 = zmnSelect.getSelectedValue(servCategSelectId);
                                    servCategId = zmnUtil.isArray(values1) && values1.length > 0 ? values1 : null;
                                }
                                return {
                                    parentIds: servCategId,
                                    showType: 2,
                                    level: 2
                                }
                            }
                        }
                    }
                })
            }
            return zmnSelect.selectBoxes({
                servCategSelectId: {
                    id: servCategSelectId,
                    sn: 1,
                },
                ecCategOneSelectId: {
                    id: ecCategOneSelectId,
                    sn: 2,
                },
                ecCategTwoSelectId: {
                    id: ecCategTwoSelectId,
                    sn: 3,
                }
            }, optionsMap, commonOptions);
        },

        /**
         * 渠道类型/1级渠道/2级渠道下拉框联动（支持渠道类型/1级渠道、1级渠道/2级渠道下拉框联动）
         * @param channelTypeSelectId
         * @param channelOneSelectId
         * @param channelTwoSelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * channelOneSelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "type": null, //渠道类型：Integer类型；1政企渠道，2平台渠道，3厂家渠道，4自有渠道，5推广渠道，6服务商渠道，7啄金客渠道，null不限
         *                  "centId": null, //所属中心：Integer类型；null不限
         *                  "deptId": null, //所属部门：Integer类型；null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see zmnSelect.selectlChannels
         */
        selectlChannel: function (channelTypeSelectId, channelOneSelectId, channelTwoSelectId, optionsMap, commonOptions) {
            return this.selectlChannels({
                channelTypeSelectId: channelTypeSelectId,
                channelOneSelectId: channelOneSelectId,
                channelTwoSelectId: channelTwoSelectId,
            }, optionsMap, commonOptions);
        },
        /**
         * 渠道级联下拉框：渠道类型/1级渠道/2级渠道
         * 子级联下拉框：
         *      渠道类型/1级渠道
         *      1级渠道/2级渠道
         * @param selectIdMap   格式：
         * {
         *     channelTypeSelectId: null, //渠道类型ID
         *     channelOneSelectId: null, //1级渠道ID
         *     channelTwoSelectId: null, //2级渠道ID
         * }
         * @param optionsMap
         * channelOneSelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "type": null, //渠道类型：Integer类型；1政企渠道，2平台渠道，3厂家渠道，4自有渠道，5推广渠道，6服务商渠道，7啄金客渠道，null不限
         *                  "centId": null, //所属中心：Integer类型；null不限
         *                  "deptId": null, //所属部门：Integer类型；null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @param commonOptions
         */
        selectlChannels: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};

            let channelTypeSelectId = selectIdMap.channelTypeSelectId;
            let channelOneSelectId = selectIdMap.channelOneSelectId;
            let channelTwoSelectId = selectIdMap.channelTwoSelectId;

            if (zmnUtil.isNotEmptyNull(channelTypeSelectId)) {
                selectMethods.selectChannelType(channelTypeSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择渠道类型-",
                })
            }

            if (zmnUtil.isNotEmptyNull(channelOneSelectId)) {
                selectMethods.selectOneChannel(channelOneSelectId, {
                    isReload: false,
                    isRadio: zmnUtil.isNotEmptyNull(channelTwoSelectId) ? true : false,
                    tips: "-选择一级渠道-",
                })
            }

            if (zmnUtil.isNotEmptyNull(channelTwoSelectId)) {
                let selectKey = "channelTwoSelectId";
                if (optionsMap.hasOwnProperty(channelTwoSelectId)) {
                    selectKey = channelTwoSelectId;
                }
                optionsMap[selectKey] = zmnSelect.mergeOptions(channelTwoSelectId, optionsMap[selectKey], {
                    tips: "-选择二级渠道-",
                    propMap: {  //选项参数映射配置
                        name: "label",   //显示值
                        value: "value"  //选中值
                    },
                    remote: {
                        enable: true,
                        url: GATEWAY_API_BASE + '/channel/api/channelListRemoteService/listChannelOptionByQuery',
                        events: {
                            params: function (searchValue, limitPermit, pageIndex) {
                                return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                    searchQuery: {
                                        limitPermit: limitPermit === true
                                    }
                                };
                            },
                            extendParams: function (prevValues, newExtendParams) {
                                return $.extend(true, {}, {
                                    searchQuery: {parentId: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null}
                                }, newExtendParams)
                            },
                            dataMap: function (resultData) {
                                let data = [];
                                if (resultData.status == 200) {
                                    data = resultData.data.options;
                                } else {
                                    console.log(resultData.message);
                                }
                                return {
                                    data: data
                                };
                            }
                        }
                    }
                });
            }
            return zmnSelect.selectBoxes({
                channelTypeSelectId: {
                    id: channelTypeSelectId,
                    sn: 1,
                },
                channelOneSelectId: {
                    id: channelOneSelectId,
                    sn: 2,
                },
                channelTwoSelectId: {
                    id: channelTwoSelectId,
                    sn: 3,
                }
            }, optionsMap, commonOptions);
        },

        /**
         * 渠道级联下拉框：1级渠道(支持多选)/2级渠道
         * 子级联下拉框：
         *      渠道类型/1级渠道
         *      1级渠道/2级渠道
         * @param selectIdMap   格式：
         * {
         *     channelOneSelectId: null, //1级渠道ID
         *     channelTwoSelectId: null, //2级渠道ID
         * }
         * @param optionsMap
         * channelOneSelectId 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "type": null, //渠道类型：Integer类型；1政企渠道，2平台渠道，3厂家渠道，4自有渠道，5推广渠道，6服务商渠道，7啄金客渠道，null不限
         *                  "centId": null, //所属中心：Integer类型；null不限
         *                  "deptId": null, //所属部门：Integer类型；null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @param commonOptions
         */
        selectlChannelOnesTwos: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};

            let channelOneSelectId = selectIdMap.channelOneSelectId;
            let channelTwoSelectId = selectIdMap.channelTwoSelectId;

            if (zmnUtil.isNotEmptyNull(channelOneSelectId)) {
                selectMethods.selectChannelOne(channelOneSelectId, {
                    isReload: false,
                    tips: "-选择一级渠道-",
                })
            }

            if (zmnUtil.isNotEmptyNull(channelTwoSelectId)) {
                let selectKey = "channelTwoSelectId";
                if (optionsMap.hasOwnProperty(channelTwoSelectId)) {
                    selectKey = channelTwoSelectId;
                }
                optionsMap[selectKey] = zmnSelect.mergeOptions(channelTwoSelectId, optionsMap[selectKey], {
                    tips: "-选择二级渠道-",
                    propMap: {  //选项参数映射配置
                        name: "label",   //显示值
                        value: "value"  //选中值
                    },
                    remote: {
                        enable: true,
                        url: GATEWAY_API_BASE + '/channel/api/channelListRemoteService/listChannelOptionByQuery',
                        events: {
                            params: function (searchValue, limitPermit, pageIndex) {
                                return zmnUtil.isEmptyNull(limitPermit)?{}:{
                                    searchQuery: {
                                        limitPermit: limitPermit === true
                                    }
                                };
                            },
                            extendParams: function (prevValues, newExtendParams) {
                                return $.extend(true, {}, {
                                    searchQuery: {parentIds: prevValues}
                                }, newExtendParams)
                            },
                            dataMap: function (resultData) {
                                let data = [];
                                if (resultData.status == 200) {
                                    data = resultData.data.options;
                                } else {
                                    console.log(resultData.message);
                                }
                                return {
                                    data: data
                                };
                            }
                        }
                    }
                });
            }
            return zmnSelect.selectBoxes({
                channelOneSelectId: {
                    id: channelOneSelectId,
                    sn: 1,
                },
                channelTwoSelectId: {
                    id: channelTwoSelectId,
                    sn: 2,
                }
            }, optionsMap, commonOptions);
        },
        /**
         * 渠道中心/1级部门/2级部门下拉框联动（支持渠道类型/1级部门、1级部门/2级部门下拉框联动）
         * @param channelCentSelectId
         * @param deptOneSelectId
         * @param deptTwoSelectId
         * @param optionsMap 配置Map，格式：{selectId: options}
         * @param commonOptions
         * @return xmSelect对象Map，格式：{selectId: xmSelect对象}
         * @deprecated
         * @see zmnSelect.selectlChannelDepts
         */
        selectlChannelDept: function (channelCentSelectId, deptOneSelectId, deptTwoSelectId, optionsMap, commonOptions) {
            return this.selectlChannelDepts({
                channelCentSelectId: channelCentSelectId,
                deptOneSelectId: deptOneSelectId,
                deptTwoSelectId: deptTwoSelectId,
            }, optionsMap, commonOptions);
        },
        /**
         * 渠道部门级联下拉框：渠道中心/1级部门/2级部门：
         * 子级联下拉框：
         *      渠道中心/1级部门
         *      1级部门/2级部门
         * @param selectIdMap  格式：
         * {
         *      channelCentSelectId: null, //渠道中心
         *      deptOneSelectId: null, //1级部门ID
         *     deptTwoSelectId: null, //2级部门ID
         * }
         * @param optionsMap
         * @param commonOptions
         */
        selectlChannelDepts: function (selectIdMap, optionsMap, commonOptions) {

            let channelCentSelectId = selectIdMap.channelCentSelectId;
            let entryOrderCentSelectId = selectIdMap.entryOrderCentSelectId;
            let deptOneSelectId = selectIdMap.deptOneSelectId;
            let deptTwoSelectId = selectIdMap.deptTwoSelectId;

            if (zmnUtil.isNotEmptyNull(channelCentSelectId)) {
                selectMethods.selectChannelCenter(channelCentSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择一级部门-",
                });
            }

            if (zmnUtil.isNotEmptyNull(entryOrderCentSelectId)) {
                selectMethods.selectChannelCenterEntryOrder(entryOrderCentSelectId, {
                    isReload: false,
                    isRadio: false,
                    tips: "-请选择-",
                });
            }

            if (zmnUtil.isNotEmptyNull(deptOneSelectId)) {
                if (zmnUtil.isNotEmptyNull(channelCentSelectId)) {
                    selectMethods.selectOrganizeDept(deptOneSelectId, {
                        isReload: false,
                        isRadio: true,
                        tips: "-选择二级部门-",
                    })
                } else {
                    selectMethods.selectChannelOneDept(deptOneSelectId, {
                        isReload: false,
                        isRadio: true,
                        tips: "-选择一级部门-",
                    })
                }
            }
            if (zmnUtil.isNotEmptyNull(deptTwoSelectId)) {

                let tips = "-选择二级部门-";
                if (zmnUtil.isNotEmptyNull(channelCentSelectId)) {
                    tips = "-选择三级部门-";
                }

                selectMethods.selectOrganizeDept(deptTwoSelectId, {
                    isRadio: true,
                    isReload: false,
                    tips: tips,
                })
            }
            return zmnSelect.selectBoxes({
                channelCentSelectId: {
                    id: channelCentSelectId,
                    sn: 1
                },
                deptOneSelectId: {
                    id: deptOneSelectId,
                    sn: 2,
                },
                deptTwoSelectId: {
                    id: deptTwoSelectId,
                    sn: 3
                }
            }, optionsMap, commonOptions);
        },

        /**
         * 入口级联下拉框：入口类型/入口
         * @param selectIdMap 格式
         * {
         *     entranceTypeSelectId: null, //入口类型ID
         *     entranceSelectId: null, //入口ID
         * }
         * @param optionsMap
         * @param commonOptions
         */
        selectlEntrances: function (selectIdMap, optionsMap, commonOptions) {
            let entranceTypeSelectId = selectIdMap.entranceTypeSelectId;
            let entranceSelectId = selectIdMap.entranceSelectId;
            if (zmnUtil.isNotNull(entranceTypeSelectId)) {
                selectMethods.selectEntranceType(entranceTypeSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择入口分类-",
                })
            }
            if (zmnUtil.isNotNull(entranceSelectId)) {
                selectMethods.selectEntrance(entranceSelectId, {
                    tips: "-选择入口-",
                    isReload: false,
                    remote: {
                        events: {
                            extendParams: function (prevValues) {
                                return {
                                    type: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null,
                                }
                            }
                        }
                    }
                })
            }
            return zmnSelect.selectBoxes({
                entranceTypeSelectId: {
                    id: entranceTypeSelectId,
                    sn: 1
                },
                entranceSelectId: {
                    id: entranceSelectId,
                    sn: 2
                }
            }, optionsMap, commonOptions);
        },
        /**
         * 服务业务单元（只针对ERP服务分类和产品分类）
         * 业务类型、业务线、产品组
         * 每个产品组包含多个服务分类、产品一级分类和产品二级分类
         */
        /**
         * 服务业务单元级联下拉框：业务类型/业务线/产品组
         * 子级联下拉框：
         *      业务类型/业务线
         * @param selectIdMap 格式：
         * {
         *     bizTypeSelectId: null, //业务类型ID
         *     bizLineSelectId: null, //业务线ID
         *     prodGroupSelectId: null, //产品组ID
         * }
         * @param optionsMap
         * @param commonOptions
         */
        selectlServBizUnits: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};

            let bizTypeSelectId = selectIdMap.bizTypeSelectId;
            let bizLineSelectId = selectIdMap.bizLineSelectId;
            let prodGroupSelectId = selectIdMap.prodGroupSelectId;

            if (zmnUtil.isNotNull(bizTypeSelectId)) {
                selectMethods.selectBizType(bizTypeSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择业务类型-",
                });
            }
            if (zmnUtil.isNotNull(bizLineSelectId)) {
                selectMethods.selectBizLine(bizLineSelectId, {
                    isReload: false,
                    tips: "-选择业务线-",
                    isRadio: zmnUtil.isNotEmptyNull(prodGroupSelectId) ? true : false,
                    remote: {
                        events: {
                            extendParams: function (prevValues) {
                                return {
                                    bizType: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null,
                                }
                            }
                        }
                    }
                });
            }
            if (zmnUtil.isNotNull(prodGroupSelectId)) {
                let selectKey = 'prodGroupSelectId';
                if (optionsMap.hasOwnProperty(prodGroupSelectId)) {
                    selectKey = prodGroupSelectId;
                }
                optionsMap[selectKey] = zmnSelect.mergeOptions(prodGroupSelectId, optionsMap[selectKey], {
                    tips: "-选择产品组-",
                    propMap: {  //选项参数映射配置
                        name: "label",   //显示值
                        value: "value"  //选中值
                    },
                    remote: {
                        enable: true,
                        url: GATEWAY_API_BASE + '/product/api/product/group/listOptionByBusinessLineId',
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return $.extend(true, {}, {
                                    businessLineId: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues[0] : null,
                                    status: 2,
                                }, newExtendParams)
                            },
                            dataMap: function (resultData) {
                                let data = [];
                                if (resultData.status == 200) {
                                    data = resultData.data.options;
                                } else {
                                    console.log(resultData.message);
                                }
                                return {
                                    data: data
                                };
                            }
                        }
                    }
                });
            }
            return zmnSelect.selectBoxes({
                bizTypeSelectId: {
                    id: bizTypeSelectId,
                    sn: 1
                },
                bizLineSelectId: {
                    id: bizLineSelectId,
                    sn: 2
                },
                prodGroupSelectId: {
                    id: prodGroupSelectId,
                    sn: 3
                }
            }, optionsMap, commonOptions);
        },
        /**
         * 服务业务单元级联下拉框：业务类型/产品组
         * @param selectIdMap 格式：
         * {
         *     bizTypeSelectId: null, //业务类型ID
         *     prodGroupSelectId: null, //产品组ID
         * }
         * @param optionsMap
         * @param commonOptions
         */
        selectlServBizTypeGroup: function (selectIdMap, optionsMap, commonOptions) {
            optionsMap = zmnUtil.isObject(optionsMap) ? optionsMap : {};

            let bizTypeSelectId = selectIdMap.bizTypeSelectId;
            let prodGroupSelectId = selectIdMap.prodGroupSelectId;

            if (zmnUtil.isNotNull(bizTypeSelectId)) {
                selectMethods.selectBizType(bizTypeSelectId, {
                    isReload: false,
                    isRadio: true,
                    tips: "-选择业务类型-",
                });
            }
            if (zmnUtil.isNotNull(prodGroupSelectId)) {
                let selectKey = 'prodGroupSelectId';
                if (optionsMap.hasOwnProperty(prodGroupSelectId)) {
                    selectKey = prodGroupSelectId;
                }
                optionsMap[selectKey] = zmnSelect.mergeOptions(prodGroupSelectId, optionsMap[selectKey], {
                    tips: "-选择产品组-",
                    propMap: {  //选项参数映射配置
                        name: "label",   //显示值
                        value: "value"  //选中值
                    },
                    remote: {
                        enable: true,
                        url: GATEWAY_API_BASE + '/product/api/product/group/listOtionByBizType',
                        events: {
                            extendParams: function (prevValues, newExtendParams) {
                                return $.extend(true, {}, {
                                    bizTypeList: zmnUtil.isArray(prevValues) && prevValues.length > 0 ? prevValues : [prevValues],
                                    status: 2,
                                }, newExtendParams)
                            },
                            dataMap: function (resultData) {
                                let data = [];
                                if (resultData.status == 200) {
                                    data = resultData.data.options;
                                } else {
                                    console.log(resultData.message);
                                }
                                return {
                                    data: data
                                };
                            }
                        }
                    }
                });
            }
            return zmnSelect.selectBoxes({
                bizTypeSelectId: {
                    id: bizTypeSelectId,
                    sn: 1
                },
                prodGroupSelectId: {
                    id: prodGroupSelectId,
                    sn: 2
                }
            }, optionsMap, commonOptions);
        },
    }

    let searchMethods = {
        /**
         * 渠道搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "firstGetAnotherName": true, //别名启用标识，Boolean类型， true启用，false关闭
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "type": null, //渠道类型：Integer类型；1政企渠道，2平台渠道，3厂家渠道，4自有渠道，5推广渠道，6服务商渠道，7啄金客渠道，null不限
         *                  "centId": null, //所属中心：Integer类型；null不限
         *                  "deptId": null, //所属部门：Integer类型；null不限
         *                  "parentId": null, //上级渠道Id：Integer类型；1表示1级渠道的parentId，null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                  "rank": null, //渠道层级：Integer类型；传入1查询一级渠道，传入2查询二级渠道,null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        searchChannel: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {  //选项参数映射配置
                    name: "label",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    url: GATEWAY_API_BASE + '/channel/api/channelListRemoteService/listChannelOptionByQuery',
                    events: {
                        params: function (searchValue, limitPermit, pageIndex) {

                            let base={keyword: searchValue};

                            if(zmnUtil.isNotEmptyNull(limitPermit)){
                                base=$.extend(true, {}, {limitPermit:limitPermit === true},base )
                            }

                            return {searchQuery:base};
                            ;
                        },
                        extendParams: function (prevValues, newExtendParams) {
                            return {searchQuery: newExtendParams};
                        },
                        dataMap: function (resultData) {
                            let data = [];
                            if (resultData.status == 200) {
                                data = resultData.data.options;
                            } else {
                                console.log(resultData.message);
                            }
                            return {
                                data: data
                            };
                        }
                    }
                }
            })
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 子公司搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "regionId": null, //大区的组织架构Id：Integer类型；null不限
         *                  "types":[{
         *                      "oneType": null, //一级分类：Integer类型；；null不限
         *                      "twoTypes": [], //二级分类：Integer数组类型；，一级分类有值时才生效；null不限
         *                  }],
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         */
        // searchThrOrg 待确认
        searchCompany: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    url: GATEWAY_API_BASE + '/common_data/api/company/listOptionPageByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let defaultParams = {}
                            if (zmnUtil.isArray(newExtendParams.types) && newExtendParams.types.length > 0) {
                                let companyTypes = [];
                                let type = null;
                                newExtendParams.types.forEach(item => {
                                    if (zmnUtil.isInteger(item.oneType)) {
                                        if (zmnUtil.isArray(item.twoTypes) && item.twoTypes.length > 0) {
                                            item.twoTypes.forEach(twoType => {
                                                if (zmnUtil.isInteger(twoType)) {
                                                    companyTypes.push({
                                                        type: parseInt(item.oneType),
                                                        childType: parseInt(twoType),
                                                    })
                                                }
                                            });
                                        } else {
                                            type = parseInt(item.oneType);
                                        }
                                    }
                                });
                                if (zmnUtil.isInteger(type)) {
                                    defaultParams.type = type;
                                }
                                if (companyTypes.length > 0) {
                                    defaultParams.companyTypeQueryList = companyTypes;
                                }
                                delete newExtendParams.types;
                            }
                            if (zmnUtil.isNotEmptyNull(newExtendParams.regionId)) {
                                defaultParams.orgTwoId = newExtendParams.regionId;
                                delete newExtendParams.regionId;
                            }
                            return {
                                query: $.extend(true, {}, defaultParams, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            let result = {
                                query: {
                                    limitPermit: limitPermit === true,
                                    name: searchValue,
                                }
                            };
                            if(zmnUtil.isEmptyNull(limitPermit)){
                                delete result.query.limitPermit;
                            }
                            if (options.page && options.page.enable === true) {
                                result.query.pageIndex = pageIndex;
                                result.query.pageSize = options.page.pageSize;
                            }
                            return result;
                        },
                        dataMap: function (resultData) {
                            let result = {
                                data: resultData.data.options,
                            }
                            if (options.page && options.page.enable === true) {
                                result.pageSize = options.page.pageSize;
                                result.totalCount = resultData.data.total;
                                if (zmnUtil.isInteger(result.totalCount) && zmnUtil.isInteger(result.pageSize) && result.pageSize > 0) {
                                    if (result.totalCount % result.pageSize === 0) {
                                        result.pageCount = parseInt(result.totalCount / result.pageSize);
                                    } else {
                                        result.pageCount = parseInt(result.totalCount / result.pageSize) + 1;
                                    }
                                }
                            }
                            return result;
                        }
                    }
                },
            });
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 服务商搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "regionId": null, //大区的组织架构Id：Integer类型；null不限
         *                  "orgThrId": null, //第三级组织架构Id：Integer类型；null不限
         *                  "companyId": null, //子公司Id：Integer类型；null不限
         *                  "type": null, //服务商类型：Integer类型；10服务商(包括信息公司和服务商)，11信息公司，12服务商，20信息公司和电器公司，21电器公司，null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        searchSpCompany: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    url: GATEWAY_API_BASE + '/common_data/api/company/listOptionPageByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let defaultParams = {
                                type: 130, //公司类型：服务商
                            }
                            let types = convertCompanyType(newExtendParams.type);
                            if (types.length > 0) {
                                defaultParams.companyTypeQueryList = types;
                                delete newExtendParams.type;
                            }
                            if (zmnUtil.isNotEmptyNull(newExtendParams.regionId)) {
                                defaultParams.orgTwoId = newExtendParams.regionId;
                                delete newExtendParams.regionId;
                            }
                            if (zmnUtil.isNotEmptyNull(newExtendParams.companyId)) {
                                defaultParams.subCompanyId = newExtendParams.companyId;
                                delete newExtendParams.companyId;
                            }
                            return {
                                query: $.extend(true, {}, defaultParams, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            let result = {
                                query: {
                                    limitPermit: limitPermit === true,
                                    name: searchValue,
                                }
                            };
                            if(zmnUtil.isEmptyNull(limitPermit)){
                                delete result.query.limitPermit;
                            }
                            if (options.page && options.page.enable === true) {
                                result.query.pagesNumber = pageIndex;
                                result.query.pageSize = options.page.pageSize;
                            }
                            return result;
                        },
                        dataMap: function (resultData) {
                            let result = {
                                data: resultData.data.options,
                            }
                            if (options.page && options.page.enable === true) {
                                result.pageSize = options.page.pageSize;
                                result.totalCount = resultData.data.total;
                                if (zmnUtil.isInteger(result.totalCount) && zmnUtil.isInteger(result.pageSize) && result.pageSize > 0) {
                                    if (result.totalCount % result.pageSize === 0) {
                                        result.pageCount = parseInt(result.totalCount / result.pageSize);
                                    } else {
                                        result.pageCount = parseInt(result.totalCount / result.pageSize) + 1;
                                    }
                                }
                            }
                            return result;
                        }
                    }
                }
            });
            return zmnSelect.searchBox(selectId, newOptions);
        }
        ,
        /**
         * 厂商搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        searchFcCompany: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    url: GATEWAY_API_BASE + '/common_data/api/company/listOptionPageByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let defaultParams = {
                                type: 230, //公司类型：厂商客户
                            }
                            return {
                                query: $.extend(true, {}, defaultParams, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            let result = {
                                query: {
                                    limitPermit: limitPermit === true,
                                    name: searchValue,
                                }
                            };
                            if(zmnUtil.isEmptyNull(limitPermit)){
                                delete result.query.limitPermit;
                            }
                            if (options.page && options.page.enable === true) {
                                result.query.pagesNumber = pageIndex;
                                result.query.pageSize = options.page.pageSize;
                            }
                            return result;
                        },
                        dataMap: function (resultData) {
                            let result = {
                                data: resultData.data.options,
                            }
                            if (options.page && options.page.enable === true) {
                                result.pageSize = options.page.pageSize;
                                result.totalCount = resultData.data.totalCount;
                                if (zmnUtil.isInteger(result.totalCount) && zmnUtil.isInteger(result.pageSize) && result.pageSize > 0) {
                                    if (result.totalCount % result.pageSize === 0) {
                                        result.pageCount = parseInt(result.totalCount / result.pageSize);
                                    } else {
                                        result.pageCount = parseInt(result.totalCount / result.pageSize) + 1;
                                    }
                                }
                            }
                            return result;
                        }
                    }
                }
            });
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 电器公司搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "status": null, //状态：Integer类型；1停用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        searchElectricCompany: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "label",
                    value: "value",
                },
                remote: {
                    url: GATEWAY_API_BASE + '/common_data/api/company/listOptionPageByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let defaultParams = {
                                type: 140, //公司类型：电器公司
                            }
                            return {
                                query: $.extend(true, {}, defaultParams, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            let result = {
                                query: {
                                    name: searchValue,
                                    limitPermit: limitPermit === true
                                },

                            };
                            if(zmnUtil.isEmptyNull(limitPermit)){
                                delete result.query.limitPermit;
                            }
                            if (options.page && options.page.enable === true) {
                                result.query.pagesNumber = pageIndex;
                                result.query.pageSize = options.page.pageSize;
                            }
                            return result;
                        },
                        dataMap: function (resultData) {
                            let result = {
                                data: resultData.data.options,
                            }
                            if (options.page && options.page.enable === true) {
                                result.pageSize = options.page.pageSize;
                                result.totalCount = resultData.data.totalCount;
                                if (zmnUtil.isInteger(result.totalCount) && zmnUtil.isInteger(result.pageSize) && result.pageSize > 0) {
                                    if (result.totalCount % result.pageSize === 0) {
                                        result.pageCount = parseInt(result.totalCount / result.pageSize);
                                    } else {
                                        result.pageCount = parseInt(result.totalCount / result.pageSize) + 1;
                                    }
                                }
                            }
                            return result;
                        }
                    }
                }
            });
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 工程师搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型，null不限
         *                  "companyId": null, //子公司Id：Integer类型，null不限
         *                  "spCompanyId": null, //服务商公司Id：Integer类型，null不限
         *                  "spCompanyType": null, //服务商类型：Integer类型，null不限
         *                  "type": null, //工程师类型：Integer类型，1自有，2第三方，null不限
         *                  "status": null, //状态：Integer类型，1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        searchEngineer: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    url: GATEWAY_API_BASE + '/engineer/api/baseInfo/searchEngineer',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return {
                                query: newExtendParams
                            };
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            return {
                                query: {
                                    keyword: searchValue,
                                    limitPermit: limitPermit === true,
                                }
                            }
                        },
                    }
                }
            });
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 工程师搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台标识：Integer类型；，null不限
         *                  "companyId": null, //子公司Id：Integer类型；null不限
         *                  "spCompanyId": null, 服务商公司Id：Integer类型；null不限
         *                  "type": null, //工程师类型：Integer类型；1自有，2第三方，null不限
         *                  "status": null, //状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.searchEngineer
         */
        searchMaster: function (selectId, options) {
            return this.searchEngineer(selectId, options);
        },
        /**
         * 员工搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "companyIdList": [],    //公司ID集合：Array类型；null不限，完全不用，待确认
         *                  "orgIdList": [],    //组织ID集合：Array类型；null不限
         *                  "deptIdList": [],   //部门ID集合：Array类型；null不限，deptIds
         *                  "status": null  //员工状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        searchStaff: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    url: GATEWAY_API_BASE + '/mcc/sapi/staff/listVtBySimpleQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let defaultParams = {};
                            //旧接口参数兼容处理
                            if (zmnUtil.isNotNull(newExtendParams.orgId)) {
                                defaultParams.orgIds = [newExtendParams.orgId];
                                delete newExtendParams.orgId;
                            }
                            if (zmnUtil.isArray(newExtendParams.companyIdList)) {
                                defaultParams.companyIds = newExtendParams.companyIdList;
                                delete newExtendParams.companyIdList;
                            }
                            if (zmnUtil.isArray(newExtendParams.orgIdList)) {
                                defaultParams.orgIds = newExtendParams.orgIdList;
                                delete newExtendParams.orgIdList;
                            }
                            if (zmnUtil.isArray(newExtendParams.deptIdList)) {
                                defaultParams.deptIds = newExtendParams.deptIdList;
                                delete newExtendParams.deptIdList;
                            }
                            return {
                                dio: $.extend(true, {}, defaultParams, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit) {
                            return {
                                dio: {
                                    keyword: searchValue,
                                }
                            }
                        }
                    }
                }
            });
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 员工搜索下拉框
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "companyIdList": [],    //公司ID集合：Array类型；null不限
         *                  "orgIdList": [],    //组织ID集合：Array类型；null不限
         *                  "deptIdList": [],   //部门ID集合：Array类型；null不限
         *                  "status": null  //员工状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.searchStaff
         */
        searchOperator: function (selectId, options) {
            return this.searchStaff(selectId, options);
        },
        /**
         * 员工搜索下拉框(指定部门及其所有子部门)
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "companyIdList": [],    //公司ID集合：Array类型；null不限
         *                  "orgIdList": [],    //组织ID集合：Array类型；null不限
         *                  "deptIdList": [],   //部门ID集合：Array类型；null不限
         *                  "status": null  //员工状态：Integer类型；1禁用，2启用，null不限
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         * @deprecated
         * @see zmnSelect.searchStaff
         */
        searchDeptAndSubDeptOperator: function (selectId, options) {

            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                remote: {
                    url: GATEWAY_API_BASE + '/mcc/sapi/staff/listVtDeptAndSubDeptBySimpleQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            let defaultParams = {};
                            //旧接口参数兼容处理
                            if (zmnUtil.isNotNull(newExtendParams.orgId)) {
                                defaultParams.orgIds = [newExtendParams.orgId];
                                delete newExtendParams.orgId;
                            }
                            if (zmnUtil.isArray(newExtendParams.companyIdList)) {
                                defaultParams.companyIds = newExtendParams.companyIdList;
                                delete newExtendParams.companyIdList;
                            }
                            if (zmnUtil.isArray(newExtendParams.orgIdList)) {
                                defaultParams.orgIds = newExtendParams.orgIdList;
                                delete newExtendParams.orgIdList;
                            }
                            if (zmnUtil.isArray(newExtendParams.deptIdList)) {
                                defaultParams.deptIds = newExtendParams.deptIdList;
                                delete newExtendParams.deptIdList;
                            }
                            return {
                                dio: $.extend(true, {}, defaultParams, newExtendParams)
                            };
                        },
                        params: function (searchValue, limitPermit) {
                            return {
                                dio: {
                                    keyword: searchValue,
                                }
                            }
                        }
                    }
                }
            });
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 工程师主管搜索下拉框：不支持远程分页、不支持权限校验
         * @param selectId
         * @param options
         * 附加参数：
         * {
         *     remote:{
         *         events:{
         *             extendParams: function(){
         *                return {
         *                  "plat": null, //平台类型（必填）：Integer类型；
         *                }
         *             }
         *         }
         *     }
         * }
         * @return xmSelect对象
         */
        searchEngineerSupervisor: function (selectId, options) {
            let newOptions = zmnSelect.mergeOptions(selectId, options, {
                propMap: {
                    name: "text",   //显示值
                    value: "value"  //选中值
                },
                remote: {
                    url: GATEWAY_API_BASE + '/engineer/api/supervisor/listPageByQuery',
                    events: {
                        extendParams: function (prevValues, newExtendParams) {
                            return newExtendParams;
                        },
                        params: function (searchValue, limitPermit, pageIndex) {
                            return {
                                searchValue: searchValue
                            }
                        }
                    },
                },
            });
            return zmnSelect.searchBox(selectId, newOptions);
        },
        /**
         * 城市搜索下拉框（城市下拉框可以满足需求，暂不实现）
         * @param selectId
         * @param options
         */
        // searchCity: function (selectId, options) {
        //
        // },
        /**
         * 区县搜索下拉框（现无应用场景，暂不实现）
         * @param selectId
         * @param options
         */
        // searchCounty: function (selectId, options) {
        //
        // }
    }

    //对外暴露的接口
    exports('zmnSelect', $.extend(true, {}, zmnSelect, selectMethods, selectlMethods, searchMethods));

});